功能要求如下:
select *,(case when credit>300 then '优质客户' when credit>200 then '中等用户' else'一般用户' end ) 客户分类 from user
select * ,(case city when '北京' then '首都' when '上海' then '魔都' when '深圳' then '特区' else '省会' end) 城市 from user
select *,ifnull(ename,'无') from user
select *, substring(personId,7,4) x from user
select *,(case when x>='1990' then '90后' when x>'1980' then '80后' when x>'1970' then '70后' else '00后' end) from (select *,substring(personId,7,4) x from user) a