case when 取别名的问题

来源:互联网 发布:声纹鉴定软件 编辑:程序博客网 时间:2024/06/04 20:06

select case when ceil((To_date(main.sheetCompleteLimit, ‘yyyy-mm-dd hh24-mi-ss’) -
To_date(sysdate, ‘yyyy-mm-dd hh24:mi:ss’)) * 24 * 60 * 60 * 1000) >=
ceil(((To_date(main.sheetCompleteLimit, ‘yyyy-mm-dd hh24-mi-ss’) -
To_date(main.sendTime, ‘yyyy-mm-dd hh24-mi-ss’)) * 24 * 60 * 60 * 1000) / 3) then 1 else 0 end outtime
from centralcommonfault_main main

使用case when then 取别名的时候 一定要卸载end 的后面,不要使用as,否则会报错的

1 0
原创粉丝点击