一个 语句的写法问题
在存储过程里下面的语句怎么修改
case
WHEN bm_yuangong.Person_zhuangtai = 0 THEN '离职 '
end as Person_zhuangtai1,
case
WHEN bm_yuangong.Person_zhuangtai = 1 THEN '试用在职 '
end as Person_zhuangtai1,
case
WHEN bm_yuangong.Person_zhuangtai = 2 THEN '正式在职 '
end as Person_zhuangtai1
就应该显示一个状态 zhuangtai1 没这么写过 请帮忙
------解决方案--------------------或者
select Person_zhuangtai1 = (case Person_zhuangtai
WHEN 0 THEN '离职 '
WHEN 1 THEN '试用在职 '
WHEN 2 THEN '正式在职 '
else ' ' END)
FROM test
------解决方案--------------------select
case bm_yuangong.Person_zhuangtai WHEN 0 THEN '离职 '
WHEN 1 THEN '试用在职 '
WHEN 2 THEN '正式在职 '
end as Person_zhuangtai1
from tb