by Kay Kwon [SQL Query] 그룹 sum [2013.07.12 10:13:22]
SELECT a.id , a.no , NVL(b.b, 0) b , NVL(c.c, 0) c , NVL(d.d, 0) d FROM a , (SELECT id, no, SUM(v) b FROM b GROUP BY id, no) b , (SELECT id, no, SUM(v) c FROM c GROUP BY id, no) c , (SELECT id, no, SUM(v) d FROM d GROUP BY id, no) d WHERE a.id = b.id(+) AND a.id = c.id(+) AND a.id = d.id(+) AND a.no = b.no(+) AND a.no = c.no(+) AND a.no = d.no(+) ORDER BY a.id, a.no ;