1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| select datecr,j.libelle,decode(substr(compte,1,2),'91','LV',
'90','LS',
'92','Ra',
'93','CT') lib,sum(nvl(credit,0))
from Xecriture e,Xjour j
where j.journal=e.journal
and e.societe=j.societe and e.societe=1
and j.journal in('11','12')
and datecr between '01/03/09' and '31/03/09'
group by decode(substr(compte,1,2),'91','LV',
'90','LS',
'92','Ra',
'93','CT') ,datecr,j.libelle
union
select datecr,j.libelle, decode(substr(compte,1,1),'7','PA' ) lib,sum(nvl(credit,0))
from Xecriture e,Xjour j
where j.journal=e.journal
and e.societe=j.societe and e.societe=1
and j.journal in('11','12')
and datecr between '01/03/09' and '31/03/09'
group by datecr,j.libelle, decode(substr(compte,1,1),'7','PA' )
union
select datecr,j.libelle, decode(substr(compte,1,5),'44221','Tb')lib, sum(nvl(credit,0))
from Xecriture e,Xjour j
where j.journal=e.journal
and e.societe=j.societe and e.societe=1
and j.journal in('11','12')
and datecr between '01/03/09' and '31/03/09'
group by datecr,j.libelle,
decode(substr(compte,1,5),'44221','Tb') |
Partager