更新 1:这是我的数据的样子。
EmployeeId EmployeeName Active
12312 bob 0
23432 rob 1
32312 dan 0
43432 jan 1
.........................
.........................
更新:
我正在照顾这样的事情。
EmployeeId EmployeeName Active
12312 bob active
23432 rob pending
.........................
.........................
我正在尝试解决以下 sql 语句,它给我一个错误,并且不确定这是否是正确的做法......
//错误:关键字“SET”附近的语法不正确。
declare @currentStatus nvarchar(50)
Select EmployeeId,EmployeeName,Active,
set @currentStatus = case when EmployeeId is not null and Active = 0 then "Active" else "Pending" end as Status
from EmployeeTable