【正文】
eptno,count(*),sum(sal) from having count(*)=5 group by tno 。 ? DEPTNO COUNT(*) SUM(SAL) 20 5 10875 30 6 9400 ? BY 用于對查詢到的結果進行排序輸出 SQL select deptno,ename,sal from order by deptno,sal desc。 ? DEPTNO ENAME SAL 10 KING 5000 10 CLARK 2450 10 MILLER 1300 20 SCOTT 3000 20 FORD 3000 20 JONES 2975 20 ADAMS 1100 20 SMITH 800 30 BLAKE 2850 30 ALLEN 1600 30 TURNER 1500 30 WARD 1250 30 MARTIN 1250 30 JAMES 950 企業(yè)通用業(yè)頻道