select top 100 State, JoinState,
(
case
when State = 1 and Joinstate = 0
then 2
when State = 1 and JoinState = 1
then 1
else 0
end
) as usestate
from UserInfo
转载于:https://www.cnblogs.com/ShenJH/archive/2011/11/03/2235073.html
select top 100 State, JoinState,
(
case
when State = 1 and Joinstate = 0
then 2
when State = 1 and JoinState = 1
then 1
else 0
end
) as usestate
from UserInfo
转载于:https://www.cnblogs.com/ShenJH/archive/2011/11/03/2235073.html