Oracle中的decode函数、nvl函数、coalesce函数的用法 ccx原创
select *,(case when SEX is "男" then 0 when SEX is "女" then 1 else 2 end) as sex from user;
等价于 select decode(SEX,"男",0,"女",1,2)sex from user;
若查询的某个字段为null 但是显示时 想显示 其他值(以显示0为例),则可以
原创
2016-10-11 14:51:42 ·
377 阅读 ·
1 评论