SQLServer_case_when_存在即是

select top 1 case isYes when  '是'  then  '是'  else '否' end 
from t_table where  t_id=tid  and isYes= '是'
有问题 ;  无法显示否 

isYes 是 否 null
显示 是 否

select top 1 case when count(1)>0 then '是' else '否' end 
from t_table where  t_id=tid  and isYes= '是'

发布了279 篇原创文章 · 获赞 113 · 访问量 78万+

猜你喜欢

转载自blog.csdn.net/icecoola_/article/details/91492582