sql查询时,根据特定的条件给表的某一个字段赋值

234 阅读1分钟

本文已参与「新人创作礼」活动,一起开启掘金创作之路。

select a.id,a.Title,a.Receiver,a.IsRead,a.NotificationMethod,a.Creation_id,a.CreationTime,b.DeptName,c.CompanyName,(case when a.IsRead >0 then '已阅读' else '未读' end) as ReadStatus from [dbo].[res_Knowledge_MessagePush] a left join res_Knowledge_PersonnelSkills b on a.Receiver = b.AD left join [dbo].[res_Knowledge_Company] c on b.RO = c.CompanyCode