摘要:--case when用法
select
case
when cast(strftime('%H','now','localtime') as int) >= 6 and cast(strftime('%H','now','localtime') as int) <=12 then '上午'
when cast(strftime('%H','now','localtime') as int) >12 and cast(strftime('%H','now','localtime') as int) <=18 then '下午'
when cast(strftime('%H','now','localtime') as int) >18 and cast(strftime('%H','now','localtime') as int) <=23 then '晚上'
else '凌晨' end;
阅读全文
04 2016 档案