MySql查询IF和CASE条件判断使用

xiaoxiao2021-02-27  551

SELECT name as '姓名',case sex when 1 then '男' when 2 then '女' else '其他' end as '性别' from tauser SELECT name as '姓名',if(sex=1,'男','女') as '性别' from tauser
转载请注明原文地址: https://www.6miu.com/read-1244.html

最新回复(0)