日期:2014-05-17 浏览次数:21407 次
WITH TABLE1 AS (
SELECT 'A' AS STR1, '1R' AS STR2,'2' AS STR3 FROM dual
union all
SELECT 'A' AS STR1, '2R' AS STR2,'4' AS STR3 FROM dual
union all
SELECT 'B' AS STR1, '1R' AS STR2,'6' AS STR3 FROM dual
union all
SELECT 'B' AS STR1, '2R' AS STR2,'8' AS STR3 FROM dual
union all
SELECT 'B' AS STR1, '3R' AS STR2,'10' AS STR3 FROM dual
)
SELECT SUM(STR3) /COUNT(0) AS STR3 FROM (
SELECT SUM(STR3) /COUNT(0) AS STR3 FROM TABLE1 GROUP BY STR1)
WITH t AS (
SELECT 'A' mc, '1日' AS rq,'2' AS jg FROM dual
union all
SELECT 'A', '2日' AS STR2,'4' AS STR3 FROM dual
union all
SELECT 'B', '1日','6' FROM dual
union all
SELECT 'B', '2日','8' FROM dual
union all
SELECT 'B', '3日','10' FROM&nbs