标量子查询的语句: select /*+ GATHER_PLAN_STATISTICS dwtest */ empno, (select count(*) from DEPT1 b where b.id = a.id) as d, (select sum(x) from DEPT1 b where b.id = a.id) as e from EMP1 a --where a.id in (1,2,3,4,5,6,7,8,9,11,12,13) 创建表: create table DEPT1 a…