SQL 条件 判断 select case as详解编程语言

select case when string="1" 
                   then "返回的数据1" 
                   when string="2" 
                   then "返回的数据2" 
           else "返回的其他数据" 
           end  as 新的列名 
from table  
where ....

 

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/13364.html

(0)
上一篇 2021年7月19日
下一篇 2021年7月19日

相关推荐

发表回复

登录后才能评论