这样查询后表中的数据并没有改变,这样查询有什么意义?表中并没有多出叫部门的一列
1 回答
已采纳

玩转IT
TA贡献30条经验 获得超30个赞
举个例子:
测试数据:
usernam age
1 lili 19
2 toto 17
select username,(case age
when 19 then '成年人'
when 17 then '未成年人'
else 'xx') as age_str
from users;
查询结果:
username age_str
1 lili 成年人
2 toto 未成年人
- 1 回答
- 0 关注
- 1383 浏览
添加回答
举报
0/150
提交
取消