case when then 的基本用法
代码语言:javascript复制SELECT
CASE
WHEN b.is_leave = 0 THEN
'在职'
WHEN b.is_leave = 1 THEN
'离职'
ELSE '状态为空'
END
FROM
sys_user_front a
LEFT JOIN sys_org_emp b ON a.info_id = b.info_id
WHERE
1 = 1
AND a.login_name = '3111111';
case when then 的基本用法
代码语言:javascript复制SELECT
CASE
WHEN b.is_leave = 0 THEN
'在职'
WHEN b.is_leave = 1 THEN
'离职'
ELSE '状态为空'
END
FROM
sys_user_front a
LEFT JOIN sys_org_emp b ON a.info_id = b.info_id
WHERE
1 = 1
AND a.login_name = '3111111';