暂无图片
为什么查询语句在SQL server中执行,在oracle中不能执行?
我来答
分享
Kevin Gee
2021-08-31
为什么查询语句在SQL server中执行,在oracle中不能执行?
select distinct h.card_no,h.name,
sum(case when CONVERT(VARCHAR(100),h.ttime,108)>'08:30' and CONVERT(VARCHAR(100),h.ttime,108)<'08:40'
then 1
else 0
END) as 迟到十分钟以内次数,
sum(case when CONVERT(VARCHAR(100),h.ttime,108)>'08:40' and CONVERT(VARCHAR(100),h.ttime,108)<'09:00'
then 1
else 0
END) as 十到三十分钟之内迟到次数,
sum(case when CONVERT(VARCHAR(100),h.ttime,108)>'09:00' and CONVERT(VARCHAR(100),h.ttime,108)<'09:30'
then 1
else 0
END) as 三十分钟以上迟到次数,
sum(case when CONVERT(VARCHAR(100),h.ttime,108)>'08:30' and CONVERT(VARCHAR(100),h.ttime,108)<'09:30'
then 1
else 0
END ) as 合计迟到次数
from h
where len(h.name)>1
group by h.card_no,h.name
order by h.card_no

我来答
添加附件
收藏
分享
问题补充
1条回答
默认
最新
Uncopyrightable

函数不一样

暂无图片 评论
暂无图片 有用 0
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏