musql的case-when-then语句
SELECT *,(CASE WHEN username='ee' THEN 'ew' WHEN username='tt' THEN 'tw' ELSE 'ee' END) AS 简称
FROM test3
语句:如果username字段值为‘ee’则在简称字段中输出‘ew’
musql的case-when-then语句
SELECT *,(CASE WHEN username='ee' THEN 'ew' WHEN username='tt' THEN 'tw' ELSE 'ee' END) AS 简称
FROM test3
语句:如果username字段值为‘ee’则在简称字段中输出‘ew’
本文标题:musql的case-when-then语句
本文链接:https://www.haomeiwen.com/subject/wctnuqtx.html
网友评论