je voudrais pour chaque op=E9ration obtenir le total par mois des
paiements et des facturations...
donc je voudrais faire une jointure ouverte "double" dans une requete
genre :
select * from
(select id_operation, montant_facture, to_char(date_facture,'MM') as
mois
from lignefacturation
group by id_operation, to_char(date_facture, 'MM') ) fact
join
(select id_operation, montant_paiement, to_char(date_paiement,'MM') as
mois
from LignePaiement
group by id_operation, to_char(date_paiement, 'MM') ) paie
on fact.id_operation (+) =3D paie..id_operation (+) and fact.mois (+) =3D
paie.mois (+)
je voudrais pour chaque opération obtenir le total par mois des paiements et des facturations...
donc je voudrais faire une jointure ouverte "double" dans une requete genre :
select * from (select id_operation, montant_facture, to_char(date_facture,'MM') as mois from lignefacturation group by id_operation, to_char(date_facture, 'MM') ) fact join (select id_operation, montant_paiement, to_char(date_paiement,'MM') as mois from LignePaiement group by id_operation, to_char(date_paiement, 'MM') ) paie on fact.id_operation (+) = paie..id_operation (+) and fact.mois (+) > paie.mois (+)
bien sur, cette syntaxe ne marche pas !
Merci pour votre aide.
Bonjour,
J'essaierai de faire une requête dans le genre :
select id_operation, mois, sum(decode(type,'facture',montant_facture,0)) total_facture, sum(decode(type,'paiement',montant_paiement,0)) total_paiement from ( select 'facture' as type, id_operation, to_char(date_facture,'MMYYYY') as mois, montant_facture union all select 'paiement' as type, id_operation, to_char(date_paiement,'MMYYYY') as mois, montant_paiement ) group by id_operation, mois;
Concernant les jointures externes à double sens, depuis la version 9 ou 10 Oracle accepte la syntaxe "FULL OUTER JOIN".
je voudrais pour chaque opération obtenir le total par mois des
paiements et des facturations...
donc je voudrais faire une jointure ouverte "double" dans une requete
genre :
select * from
(select id_operation, montant_facture, to_char(date_facture,'MM') as
mois
from lignefacturation
group by id_operation, to_char(date_facture, 'MM') ) fact
join
(select id_operation, montant_paiement, to_char(date_paiement,'MM') as
mois
from LignePaiement
group by id_operation, to_char(date_paiement, 'MM') ) paie
on fact.id_operation (+) = paie..id_operation (+) and fact.mois (+) > paie.mois (+)
bien sur, cette syntaxe ne marche pas !
Merci pour votre aide.
Bonjour,
J'essaierai de faire une requête dans le genre :
select id_operation,
mois,
sum(decode(type,'facture',montant_facture,0)) total_facture,
sum(decode(type,'paiement',montant_paiement,0)) total_paiement
from (
select 'facture' as type, id_operation, to_char(date_facture,'MMYYYY')
as mois, montant_facture
union all
select 'paiement' as type, id_operation, to_char(date_paiement,'MMYYYY')
as mois, montant_paiement
)
group by id_operation, mois;
Concernant les jointures externes à double sens, depuis la version 9 ou
10 Oracle accepte la syntaxe "FULL OUTER JOIN".
je voudrais pour chaque opération obtenir le total par mois des paiements et des facturations...
donc je voudrais faire une jointure ouverte "double" dans une requete genre :
select * from (select id_operation, montant_facture, to_char(date_facture,'MM') as mois from lignefacturation group by id_operation, to_char(date_facture, 'MM') ) fact join (select id_operation, montant_paiement, to_char(date_paiement,'MM') as mois from LignePaiement group by id_operation, to_char(date_paiement, 'MM') ) paie on fact.id_operation (+) = paie..id_operation (+) and fact.mois (+) > paie.mois (+)
bien sur, cette syntaxe ne marche pas !
Merci pour votre aide.
Bonjour,
J'essaierai de faire une requête dans le genre :
select id_operation, mois, sum(decode(type,'facture',montant_facture,0)) total_facture, sum(decode(type,'paiement',montant_paiement,0)) total_paiement from ( select 'facture' as type, id_operation, to_char(date_facture,'MMYYYY') as mois, montant_facture union all select 'paiement' as type, id_operation, to_char(date_paiement,'MMYYYY') as mois, montant_paiement ) group by id_operation, mois;
Concernant les jointures externes à double sens, depuis la version 9 ou 10 Oracle accepte la syntaxe "FULL OUTER JOIN".
je voudrais pour chaque opération obtenir le total par mois des paiements et des facturations...
donc je voudrais faire une jointure ouverte "double" dans une requete genre :
select * from (select id_operation, montant_facture, to_char(date_facture,'MM') as mois from lignefacturation group by id_operation, to_char(date_facture, 'MM') ) fact join (select id_operation, montant_paiement, to_char(date_paiement,'MM') as mois from LignePaiement group by id_operation, to_char(date_paiement, 'MM') ) paie on fact.id_operation (+) = paie..id_operation (+) and fact.mois (+) > paie.mois (+)
bien sur, cette syntaxe ne marche pas !
Merci pour votre aide.
Utilise le syntaxe ANSI SQL standard avec FULL OUTER JOIN.
select * from LigneFacturation F full outer join LignePaiement P on F.id_operation = P.id_operation and F.mois = P.mois
A+ Serguei TARASSOV MCITP SQL Server Dev/DBA http://sgbd.arbinada.com
je voudrais pour chaque opération obtenir le total par mois des
paiements et des facturations...
donc je voudrais faire une jointure ouverte "double" dans une requete
genre :
select * from
(select id_operation, montant_facture, to_char(date_facture,'MM') as
mois
from lignefacturation
group by id_operation, to_char(date_facture, 'MM') ) fact
join
(select id_operation, montant_paiement, to_char(date_paiement,'MM') as
mois
from LignePaiement
group by id_operation, to_char(date_paiement, 'MM') ) paie
on fact.id_operation (+) = paie..id_operation (+) and fact.mois (+) > paie.mois (+)
bien sur, cette syntaxe ne marche pas !
Merci pour votre aide.
Utilise le syntaxe ANSI SQL standard avec FULL OUTER JOIN.
select *
from
LigneFacturation F
full outer join
LignePaiement P
on
F.id_operation = P.id_operation
and F.mois = P.mois
A+
Serguei TARASSOV
MCITP SQL Server Dev/DBA
http://sgbd.arbinada.com
je voudrais pour chaque opération obtenir le total par mois des paiements et des facturations...
donc je voudrais faire une jointure ouverte "double" dans une requete genre :
select * from (select id_operation, montant_facture, to_char(date_facture,'MM') as mois from lignefacturation group by id_operation, to_char(date_facture, 'MM') ) fact join (select id_operation, montant_paiement, to_char(date_paiement,'MM') as mois from LignePaiement group by id_operation, to_char(date_paiement, 'MM') ) paie on fact.id_operation (+) = paie..id_operation (+) and fact.mois (+) > paie.mois (+)
bien sur, cette syntaxe ne marche pas !
Merci pour votre aide.
Utilise le syntaxe ANSI SQL standard avec FULL OUTER JOIN.
select * from LigneFacturation F full outer join LignePaiement P on F.id_operation = P.id_operation and F.mois = P.mois
A+ Serguei TARASSOV MCITP SQL Server Dev/DBA http://sgbd.arbinada.com