sql中的case when 的用法涉及到大于小于号

此文章仅仅是涉及到在select中的case when的用法:

select

a

,b

,c

,d

,e

,f     --f字段可以同时出现

,'LL'=  ----LL 可以根据自己的需要变换

case

when f<50 then 'z'                   --涉及到小于

when f between 50 and 80 then 'y'  --涉及到小于,大于等于

when f between 80 and 90 then 'x'

else 'w'  --大于90

end

from mmm

order by a --order by 可有可无 根据需要

posted @ 2013-01-03 11:17  笑看天下  阅读(32264)  评论(1编辑  收藏  举报