How do you replace symbols in the Oracle wm_concat() function?

In Oracle database, you can use the wm_concat() function to concatenate the values of multiple rows into one string. By default, the result of the wm_concat() function is connected using a comma as a delimiter. If you want to change the delimiter, you can use the replace() function to replace the comma with another symbol.

Here is an example where commas in a string connected using the wm_concat() function are replaced with semicolons.

SELECT REPLACE(wm_concat(column_name), ',', ';')
FROM table_name;

In the above example, replace ‘column_name’ with the name of the column to join and replace ‘table_name’ with the name of the table to query. After running the query, a string will be returned with commas replaced by semicolons.

bannerAds