select deptno, sum(sal) from emp
where a_opt_no = 1
group by deptno
UNION
select deptno, sum(comm) from emp
where a_opt_no = 2
group by deptno
order by deptno
/
because GROUP BY relates for each select in UNION.
|
Results 1 to 10 of 11
Thread: Three quries one reportThreaded View
|
Click Here to Expand Forum to Full Width |