Oracle语句

分页查询:

select rn,last_name,salary from(
       select rownum rn,last_name,salary from(
              select last_name,salary from employees order by salary desc
       )
) where rn>10 and rn<=20

因为rownum只能用<,<=,所以将rn当成真实的一列供外部查询语句查询。

查询两个时间的月份数:round(months_between(sysdate,hire_date),1)

posted on 2016-07-20 22:48  james-roger  阅读(141)  评论(0编辑  收藏  举报