Oracle数据库Date格式化及Select时Case的使用

--Date格式化片段
to_char(create_date,'YYYYMMDD') as date

--格式化系统当前日期
select to_char(sysdate,'YYYYMMDD') from dual;

--Select时Case片段
select case 
when item_a like 'A%' and item_b = 'b' then 'one'
when item_a like 'A%' and item_b = 'B' then 'two'
else 'other' end as type
from table_name

发表回复

您的电子邮箱地址不会被公开。

16 − 8 =