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 可有可无 根据需要


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM