2015-06-06 55 views
0

下面提到的遊標代碼僅適用於Oracle 11g,因爲LISTAGG()函數引入了起始版本11g。我需要爲Oracle 10g修改此代碼。任何幫助,將不勝感激。用於Oracle 10g中數據選擇的高級遊標

SELECT DISTINCT (t3.field1), t3.field2, 
     LISTAGG(t3.field3, ', ') WITHIN GROUP (ORDER BY t3.field3), 
     SUM(t2.field1), SUM(t2.field2), SUM(t3.field3) 
    FROM Table1 t1, Table2 t2, Table3 t3 
WHERE t1.id = t2.idoft1 
    AND t2.id = t3.idoft2 
GROUP BY t3.field1, t3.field2; 
+0

甲骨文基地擁有[許多不同的方法供您選擇(http://oracle-base.com/articles/misc/string-aggregation-techniques.php)。 – APC

回答