ITPub博客

首页 > 数据库 > Oracle > 一个SQL语句的优化

一个SQL语句的优化

原创 Oracle 作者:macheraters 时间:2009-12-07 17:20:37 0 删除 编辑

select to_char(tt.yearmonth,'yyyy') year,to_char(tt.yearmonth,'mm') month,
tt.yearmonth,max(total) over (partition by to_char(tt.yearmonth,'yyyy') order by yearmonth)
from(select trunc(hiredate,'mm') yearmonth,max(sal) total from emp
group by trunc(hiredate,'mm') order by trunc(hiredate,'mm')) tt

[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/20887841/viewspace-1029432/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    6
  • 访问量
    10346