SELECT ID, Division, EffectiveDate, PM, Status, Name, Address, ProjectType
FROM intranet.t_bidinfo
WHERE Division = 'TI'
AND EffectiveDate >= curdate()
AND Status = 1
ORDER BY EffectiveDate ASC
;
我需要在我的sql语句中将Status
的返回值更改为'Active'而不是1,我将如何正确地执行此操作?
答案 0 :(得分:0)
用例陈述:
SELECT ID, Division, EffectiveDate, PM, case Status when 1 then 'Active' end as Status, Name, Address, ProjectType
FROM intranet.t_bidinfo
WHERE Division = 'TI'
AND EffectiveDate >= curdate()
AND Status = 1
ORDER BY EffectiveDate ASC
;