1 2 3 4 5 6 7 8 9 10 11 12 13
| select t.accode,sum,s.compte,s.soldes from (
select h.cmpcode,accode , sum(DECODE(DEBITCREDIT,160,-l.VALUEDOC, VALUEDOC)) as sum
from oas_linkline l, oas_linkhead h
where h.cmpcode = '0213'
and h.cmpcode = l.cmpcode
and h.doccode = l.doccode
and h.docnum = l.docnum
and h.linkcode = l.linkcode
and h.linkcode in ('DURGG0000124','DURGG0000125','DURGG0000126','DURGG0000127','DURGG0000128','DURGG0000129','DURGT0000058')
group by accode,h.cmpcode
) t, sod_temp_soldes s
where t.accode(+) = s.compte (+)
and t.cmpcode(+) = s.cmpcode(+) |
Partager