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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
SQL*Plus: Release 8.1.7.0.0 - Production on Je Mai 22 19:25:11 2008
(c) Copyright 2000 Oracle Corporation. All rights reserved.
Connecté à :
Oracle Database 10g Release 10.2.0.1.0 - Production
SQL> select sum(dav) dav,
2 sum(cav) cav,
3 sum(dap) dap,
4 sum(cap) cap,
5 sum(sd) sd,
6 sum(sc) sc
7 from (
8 select refpayeur "refpayeur",
9 decode(sign(sum(dav)-sum(cav)), 1, sum(dav)-sum(cav), 0) dav,
10 decode(sign(sum(dav)-sum(cav)), -1, sum(cav)-sum(dav), 0) cav,
11 sum(dap) dap,
12 sum(cap) cap,
13 decode(sign(sum(dav)+sum(dap)-sum(cav)-sum(cap)), 1, sum(dav)+sum(dap)-sum(cav)-sum(cap), 0) sd,
14 decode(sign(sum(dav)+sum(dap)-sum(cav)-sum(cap)), -1, sum(cav)+sum(cap)-sum(dav)-sum(dap), 0) sc
15 from tmpbalance
16 -- where sens = -1
17 where idsession=51
18 group by refpayeur
19 )
20 /
dav cav dap cap sd sc
---------- ----------- ---------- ----------- ---------- -----------
4585186,28 4584322,41 14773219,7 14775070,5 5082071,79 5083058,71
SQL> select sum(dav) dav,
2 sum(cav) cav,
3 sum(dap) dap,
4 sum(cap) cap,
5 sum(sd) sd,
6 sum(sc) sc
7 from (
8 select refpayeur "refpayeur",
9 decode(sign(sum(dav)-sum(cav)), 1, sum(dav)-sum(cav), 0) dav,
10 decode(sign(sum(dav)-sum(cav)), -1, sum(cav)-sum(dav), 0) cav,
11 sum(dap) dap,
12 sum(cap) cap,
13 decode(sign(sum(dav)+sum(dap)-sum(cav)-sum(cap)), 1, sum(dav)+sum(dap)-sum(cav)-sum(cap), 0) sd,
14 decode(sign(sum(dav)+sum(dap)-sum(cav)-sum(cap)), -1, sum(cav)+sum(cap)-sum(dav)-sum(dap), 0) sc
15 from tmpbalance
16 -- where sens = -1
17 where idsession=51
18 group by refpayeur
19 )
20 /
dav cav dap cap sd sc
---------- ----------- ---------- ----------- ---------- -----------
4584322,41 4584322,41 14775580 14775580 5083041,21 5083041,21
SQL> select sum(dav) dav,
2 sum(cav) cav,
3 sum(dap) dap,
4 sum(cap) cap,
5 sum(sd) sd,
6 sum(sc) sc
7 from (
8 select refpayeur "refpayeur",
9 decode(sign(sum(dav)-sum(cav)), 1, sum(dav)-sum(cav), 0) dav,
10 decode(sign(sum(dav)-sum(cav)), -1, sum(cav)-sum(dav), 0) cav,
11 sum(dap) dap,
12 sum(cap) cap,
13 decode(sign(sum(dav)+sum(dap)-sum(cav)-sum(cap)), 1, sum(dav)+sum(dap)-sum(cav)-sum(cap), 0) sd,
14 decode(sign(sum(dav)+sum(dap)-sum(cav)-sum(cap)), -1, sum(cav)+sum(cap)-sum(dav)-sum(dap), 0) sc
15 from tmpbalance
16 -- where sens = -1
17 where idsession=51
18 group by refpayeur
19 )
20 /
dav cav dap cap sd sc
---------- ----------- ---------- ----------- ---------- -----------
4584322,41 4584322,41 14775580 14775580 5083041,21 5083041,21 |
Partager