SQL利用Case When Then多条件判断

 

Select top 100 State,JoinState, 
(
case when State=1 and Joinstate=0 then 2 when State=1 and JoinState=1 then 1 else 0 endas usestate from UserInfo
原文地址:https://www.cnblogs.com/hanguoji/p/1012244.html