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条回答
默认
最新
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
墨值悬赏

评论
