我的Status列在“Members”表中有一个整数数据类型。它将值存储为“0”和“1”。但在选择时我想显示“活跃”和“非活跃”。
如何使用Query执行此操作?
答案 0 :(得分:0)
SELECT CASE [Status]
WHEN '0' THEN 'Active'
ELSE 'Not Active'
END AS MemberStatus
FROM member
答案 1 :(得分:-1)
Select
Status,
case when Status = 1 then 'Active'
else 'In-Active'
end as TextStatus
from
Members