MySQL CASE WHEN 多个判断条件

SELECT 
CASE WHEN STATUS='1' THEN '状态1'
WHEN STATUS='2' THEN '状态2'
WHEN STATUS='3' THEN '状态3'
WHEN STATUS='0' THEN '状态4'
ELSE '状态5' END AS '状态' 
FROM table;

 

posted @ 2023-02-02 06:43  锐洋智能  阅读(181)  评论(0编辑  收藏  举报