oracle 语句的妙用例子
select a.dept_code 科室编码,
a.dept_name 科室名称,
(sysdate + rownum - 1) 看诊时间,
to_char(sysdate + rownum - 1, 'day') 星期,
(CASE WHEN to_number(to_char(sysdate + rownum - 1,'hh24')) BETWEEN 6 AND 11 THEN '上午' WHEN to_number(to_char(sysdate + rownum - 1,'hh24')) BETWEEN 11 AND 17 THEN '下午' WHEN to_number(to_char(sysdate + rownum - 1,'hh24')) BETWEEN 17 AND 21 THEN '晚上' END) 午别
from com_department a
where a.regdept_flag = '1'