不知道是不是这个意思select phonenum,sum(charge) as total from (
select phonenum,charge from a01
union
select phonenum,charge from a02
union
select phonenum,charge from a03
) a where rownum<=10 group by phonenum order by total desc;
select phonenum,charge from a01
union
select phonenum,charge from a02
union
select phonenum,charge from a03
) a where rownum<=10 group by phonenum order by total desc;
解决方案 »
- sqluldr2 oracle blob
- Oracle的几个试题 帮帮忙
- oracle中如何删除100条以后的数据
- oracle触发器,插入数据失败后,不出现报错的页面
- 求教高手建立临时表问题
- 字段值拆分合并的问题
- Oracle连接不上???????出错于msvcrt.dll
- 请问如何安装oracle patch set?(oracle 8.1.7.0.0)(急)
- 急!急!]为什么在pl/sql中使用desc tablename命令不好使?弹出错误提示"ORA-01460:未实现或无理的转换请求"??
- 如何在Linux8.0下安裝oracle9
- 安装oracle 9.2时提示我“C:\Documents and Settings\用户名\Local Settings\Temp\没有足够的磁盘空间,怎么回事?
- 问一个简单sql语句-统计相关的
select tt.phonenum
from (
select AA.phonenum,
sum(AA.charge) as all_charges
from (
select phonenum,charge from A01
union all
select phonenum,charge from A02
union all
select phonenum,charge from A03
)AA
group by AA.phonenum
order by 2 desc
)tt
where rownum <= 10;
我刚好摸索出来
发帖前是处于
2楼的状态
group order where 的顺序没搞清
查处的数据是错的where rownum <=10 group by phonenum order by total desc