标签:div day nbsp null else blog sql 显示 end
1.查询图书价格,若价格为null,则显示unknown,若价格为10到20, 则显示10 to 20
SELECT price, CASE WHEN price=‘null‘ THEN ‘UnKnow‘ WHEN price>10 and price<20 then ‘10 to 20‘ END FROM book;
2.
select name, case when birthday<‘1981‘ then ‘old‘ when birthday>‘1988‘ then ‘yong‘ else ‘ok‘ END YORN from lee;
3.
select NAME, case name when ‘sam‘ then ‘yong‘ when ‘lee‘ then ‘handsome‘ else ‘good‘ end from lee;
标签:div day nbsp null else blog sql 显示 end
原文地址:http://www.cnblogs.com/jiao-/p/7569877.html