1.ORACLE列变行加合计:
查询结果为
1 SELECT 2 nvl( F, '合计' ) F, 3 sum( S1 ) S1, 4 sum( S2 ) S2, 5 sum( S3 ) S3 6 FROM 7 (SELECT 8 F, 9 sum( decode( S, 'S1', N, NULL ) ) S1,10 sum( decode( S, 'S2', N, NULL ) ) S2,11 sum( decode( S, 'S3', N, NULL ) ) S3 12 FROM13 LQG_TEST 14 GROUP BY15 F)16 GROUP BY17 rollup (18 F)
2.Oracle-01033