解决方案 »
- 有关distinct问题
- 求教如何求出每天同一时间段的数据
- oracle ORA-00936异常
- 创建触发器出错
- 请问在oracle里有什么是对应mssql中columns_updated功能的?
- 请问关于客户端连接服务器oracle的问题
- 存储过程中的事务处理
- VNI-2015: Authentication Error 是什么错误 ,那里能看到所有的 Oracle8i Error Messages 信息.
- 调查:广州Oracle DBA 薪金能拿多少K/月?东莞,深圳呢?
- oracle某张表中索引混乱!
- 关于Oracle 分组统计和数据填充的问题!请高手们指教下!
- 求SQL语句(刚才的提问描述出错了)
insert into table_test
select sum(FBSUM),sum(HFSUM),sum(USESUM),sum(ZFSUM)
from table_test
from tab
2 select '2' id,200 sal,200 money from dual union all
3 select '3' id,300 sal,200 money from dual union all
4 select '4' id,400 sal,200 money from dual )
5 select nvl(id,'合计') id,sal,money
6 from
7 (select id,sum(sal) sal,sum(money) money
8 from tb
9 group by rollup(id)
10 order by id nulls first) z
11 ;ID SAL MONEY
---- ---------- ----------
合计 1000 800
1 100 200
2 200 200
3 300 200
4 400 200
SELECT FBSUM,HFSUM,USESUM,ZFSUM FROM table_test
UNION ALL
SELECT SUM(FBSUM),SUM(HFSUM),SUM(USESUM),SUM(ZFSUM)
FROM TABLE_TEST
ORDER BY FBSUM DESC