Oracle 拾遗(一)

Having语句

是对聚合函数的筛选,如:countmaxminavgsum。一般在group by语句中使用。

例如:

select deptno, job, avg(sal)

from emp

where hiredate >= to_date('1981-05-01','yyyy-mm-dd')

group by deptno,job

having avg(sal) > 1200

 

Rownum行号

select * from emp where rownum<=5 order by sal desc 返回前五行

原文地址:https://www.cnblogs.com/Johnny_Z/p/1870951.html