case when有两种写法,参见:
http://www.malaoshi.top/show_1EFhQqz16Lh.html
在判断null时只能用下面这种方法
select id ,(case when sex= '' then 'bbbbb'
when sex is null then 'aaaaa'
else sex end ) as sex FROM aa;
case when有两种写法,参见:
http://www.malaoshi.top/show_1EFhQqz16Lh.html
在判断null时只能用下面这种方法
select id ,(case when sex= '' then 'bbbbb'
when sex is null then 'aaaaa'
else sex end ) as sex FROM aa;