select b.dname,a.sal from (select deptno,sum(sal) sal from epm group by deptno ) a,(select deptno,dname) b where a.deptno=b.deptno order by 1,2;意思是根据第一列和第二列排序 相当于 order by b.dname,a.sal