表结构:
序号 显示值 实际值 参数
xuhao xianshi shiji canshu
1 123 1000 参数1
2 234 2000 参数1
1 312 3000 参数2
2 424 4000 参数2
我想得到这样的查询结果:canshu xuhao xianshi shiji xuhao xianshi shiji
参数1 1 123 1000 2 234 2000
参数2 1 312 3000 2 424 4000
有办法写sql吗?希望大侠帮帮忙
序号 显示值 实际值 参数
xuhao xianshi shiji canshu
1 123 1000 参数1
2 234 2000 参数1
1 312 3000 参数2
2 424 4000 参数2
我想得到这样的查询结果:canshu xuhao xianshi shiji xuhao xianshi shiji
参数1 1 123 1000 2 234 2000
参数2 1 312 3000 2 424 4000
有办法写sql吗?希望大侠帮帮忙
解决方案 »
- ask lpc19598188
- 100分求助,请各位高手帮帮偶!!
- 请教 oracle 5用户和30用户的版本有何不同?具体如何限制呢?
- oracle 11g 64bit安装问题
- oracle检测
- 请问:怎么在linux下启动Oracle10g数据库服务,怎么把它设为开机自启动
- 请问各位大虾:oracle817卸载后无法重装是怎么回事?
- 从那个表中可以取出某表的主键字段,外键及相关联的表名等之类的信息?
- 咋还原select username,password from dba_users中password的本来面目???
- select index_meg_seq.nextval from table 是什么意思?
- 【小菜问题1】の如何肯大骨头
- 基于DDL语句的触发器
select canshu,1 xuhao,
max(decode(xuhao,1,xianshi))xianshi,
max(decode(xuhao,1,shiji))shiji,
2 xuhao,
max(decode(xuhao,2,xianshi))xianshi,
max(decode(xuhao,2,shiji))shiji
from table1
group by canshu
希望面试官也这么认为,嘿嘿
max(decode(xuhao,1,xianshi))xianshi
的含义吗?
xianshi列的输出结果怎么是空啊?
max是相对group by进行的聚合
你将max都去掉,然后注释掉group by 看看就知道了
xianshi列的输出结果怎么是空啊?--应该不会吧,你看下代码和运行结果,最好是自己能够理解代码的意思,根据需要进行修改