mysql查询用if控制显示列

1: select *,if(sex=1,”男”,”女”) as sex from user
2: select CASE sex WHEN 1 THEN ‘男’ ELSE ‘女’ END as sex from user

posted @ 2016-08-04 09:38  吃我一棒  阅读(755)  评论(0编辑  收藏  举报