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