首页 > 其他 > 详细

10.4 补充范围内丢失的值

时间:2017-09-14 22:40:55      阅读:270      评论:0      收藏:0      [点我收藏+]

select y.yr.coalesce(x.cnt,0) as cnt
from (
select min_year-mod(cast(min_year as int),10)+rn as yr
from (
select (select min(extract(year from hreadate))
from emp) as min_year,
id-1 as rn
from t10
) a
) y
left join
(
select extract(year from hredate) as yr,count(*) as cnt
from emp
group by extract(year from hiredate)
) x
on (y.yr=x.yr);

10.4 补充范围内丢失的值

原文:http://www.cnblogs.com/liang545621/p/7523351.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!