日期:2014-05-17 浏览次数:21491 次
-- 不考虑周六、日及节假日的话,可以简单这样写:
SELECT (case when to_char(sysdate,'HHMI')<'0800' OR to_char(sysdate,'HHMI')>'1700'
then '非上班时间'
else '上班时间' end) as "现在是否为上班时间"
FROM dual;
------解决方案--------------------
select case
when to_char(sysdate, 'hh24miss') between '080000' and '165959' then
'上班时间'
else
'下班时间'
end
from dual;