student表中数据:name type
--------------------------
大黄 3
小白 1
多多 1
大黄 1
大黄 2
小宝 1
小宝 2
小宝 3查询结果:type=1 type=2 type=3
------------------------
小白 null null
多多 null null
大黄 大黄 大黄
小宝 小宝 小宝
解决方案 »
- oracle 11g 配置监听
- insert语句问题
- 关于全外连接的问题!!!!!!!!!!!
- insert 数字转换的问题?
- 远程导表的问题,急
- 如何将任意格式的数据(Excel,FoxPro,Access,SQL-Server......)导入Oracle?
- 一个复杂的SQL语句上的问题
- rollback表空间删除了,数据库打不开了,怎么办?
- 二次排序SQL咨询
- 如何监控用户访问视图和抽取数据
- 用PL/SQL Developer 写的insert语句 中文数据出现乱码
- Oracle 9.2.0.4 安装的过程提示 Oracle Required Support Files 32 bit ……
max(case when type=2 then name end) t2,
max(case when type=3 then name end) t3
from student
group by name
max(decode(t.type,'1',t.type,null)) type1,
max(decode(t.type,'2',t.type,null)) type2,
max(decode(t.type,'3',t.type,null)) type3
from student t
group by t.name
max(decode(t.type,'1',t.name,null)) type1,
max(decode(t.type,'2',t.name,null)) type2,
max(decode(t.type,'3',t.name,null)) type3
from test t
group by t.name
max(decode(type,2,type,null)) type2,
max(decode(type,3,type,null)) type3
from s_stu