mysql case when then用法

2019-06-20 20:58:30 浏览数 (1)

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';

0 人点赞