decode 的用法
来源:互联网 发布:科比81分比赛数据统计 编辑:程序博客网 时间:2024/06/03 12:30
student subject grade
---------------------------
student1 语文 80
student1 数学 70
student1 英语 60
student2 语文 90
student2 数学 80
student2 英语 100
……
转换为
语文 数学 英语
student1 80 70 60
student2 90 80 100
……
语句如下:
select student,sum(decode(subject,'语文', grade,null)) "语文",
sum(decode(subject,'数学', grade,null)) "数学",
sum(decode(subject,'英语', grade,null)) "英语"
from table
group by student
这个其实可以用case来实现 效果一样 但是 decode简单点!
- decode 函数的用法
- decode 函数的用法
- DECODE 的用法
- decode函数的用法
- decode函数的用法
- Decode 函数的用法
- decode 函数的用法
- decode 的用法
- decode的用法
- Oracle DECODE 的用法
- Decode的用法
- plsql decode的用法
- PLSQL decode的用法
- decode函数的用法
- Oracle decode的用法
- sql:decode()的用法
- decode()的用法
- oracle decode函数的用法
- C# 数据缓存操作Cache
- C++语法
- 无线路由WDS无线中继功能详解[转]
- MySQL 备份和恢复
- 关于随机数的例子
- decode 的用法
- ssh安装 和 scp命令 使用
- EVC VC 载入位图函数
- 用web报表软件来弥补Excel的不足
- 如何学习一门计算机语言?
- 桥接模式和中继模式的区别【转】
- Automation for the people: Choosing a Continuous Integration server
- How can I disable the User Account Control (UAC) feature on my Windows Vista computer?
- 【英语学习】trailblazer