我的表单中有一个“你是否寻求医疗”复选框,它将值返回为true或false。我想在一个表单中打印出这个结果,但是我希望该值返回'Did / Did not medical medical attention'而不是boolean值。到目前为止我有这个:
Case when md.seen_doctor = 'FALSE' THEN CAST (md.gweld_doctor AS Varchar(15))
我不知道如何分配不同的值。
答案 0 :(得分:1)
select case when md.seen_doctor = 'FALSE'
then 'Did not seek medical attention'
else 'Did seek medical attention'
end as res_checkbox
from your_table
答案 1 :(得分:0)
SELECT
CASE WHEN
md.seen_doctor = 0
THEN 'Did not seek medical attention'
ELSE 'Did seek medical attention'
end 'Med_Checkbox'
FROM
tbltablename