1.简单sql一例
SELECT top 10 CASE WHEN IDENTITY_ID=‘1‘ THEN ‘管理员‘ WHEN IDENTITY_ID=‘5‘ THEN ‘学生‘ ELSE ‘无‘ END as ‘身份‘ FROM [BDAS200051].[t_base_person]
2.显示结果
SQL Server的case when用法
原文:https://www.cnblogs.com/dslx/p/9217293.html