sql - 如何在oracle sql中创建记录的别名
问题描述
我有一个带有 2 列滚动和出勤率的表临时表
roll attendance
--------------
1 A
2 P
3 NA
我想将此表打印为
roll attendance
--------------
1 Absent
2 Present
3 Not applicable
解决方案
您可以使用case
表达式:
select roll,
case attendance
when 'A' then 'Absent'
when 'P' then 'Present'
when 'NA' then 'Not applicable'
end as attendance
from mytable
推荐阅读
- r - 用gmapsdistance计算R中的旅行时间
- javascript - 在 appium 中拖放更快
- python - 如何使用正则表达式将子字符串分配给变量?
- php - 在将我的 laravel 6 项目上传到 000webhosting 时,出现如下错误:
- python - 根据列绘制不同颜色的线
- spring - 无法连接到 Command Metric Stream。在 Hystrix 仪表板问题中
- authentication - 当使用 JWT 进行身份验证时,自定义范围(权限/声明)应该进入访问令牌还是 id 令牌?
- python - Can I use Node.js for the back end and Python for the AI calculations?
- java - 将一个列表中的值复制到另一个对象,该对象可以由 maps 键有效地唯一标识
- apache-kafka - How add HDFS connector to Kafka Connect API?