WM_Concat Function

WM_CONCAT is a unsupported Oracle string concatenating function (tested in Oracle 10gR2). In Oracle 11g, LISTAGG function can be used to get same the functionality.
String concatenation can also be done by custom function

WM_Concat Oracle string concatenation Function
SELECT
  qt_test.bus_unit,
  wm_concat(qt_test.sales) sales_data,
  SUM(sales) sales_totals
FROM
 (SELECT  10 as bus_unit, 2000 sales from dual UNION ALL
  SELECT  10 as bus_unit, 2500 sales from dual UNION ALL
  SELECT  20 as bus_unit, 2500 sales from dual UNION ALL
  SELECT  20 as bus_unit, 1500 sales from dual UNION ALL
  SELECT  20 as bus_unit, 1500 sales from dual UNION ALL
  SELECT  10 as bus_unit, 2500 sales from dual UNION ALL
  SELECT  30 as bus_unit, 4500 sales from dual UNION ALL
  SELECT  30 as bus_unit, 3000 sales from dual UNION ALL
  SELECT  30 as bus_unit, 4000 sales from dual
 ) qt_test
GROUP BY qt_test.bus_unit;



Oracle registered trademark of Oracle Corporation.
Last Revised On: September 27, 2013

  1261