sqlserver select 查询字段if判断用法
SELECT TOP 1000 [id],
case when group_id>1 then 'vip'
else '普通会员'
end
FROM [YaleBaoV2].[dbo].[ylb_users]
SELECT TOP 1000 [id],
case group_id when 1 then '普通会员'
when 3 then '代理商'
when 4 then 'VIP用户'
end
FROM [YaleBaoV2].[dbo].[ylb_users]