Example:
Col_id | Col_Name |
---|---|
1 | Apples |
2 | Oranges |
3 | Grapes |
4 | Pineapple |
SQL Query:
SELECT RTRIM(XMLAGG(XMLELEMENT(e,a.col_Name
|| '; ')).EXTRACT('//text()'),'; ') new_column
FROM TABLE_NAME a;
Output:
New_column |
---|
Apples,Oranges,Grapes,Pineapple |
Col_id | Col_Name |
---|---|
1 | Apples |
2 | Oranges |
3 | Grapes |
4 | Pineapple |
New_column |
---|
Apples,Oranges,Grapes,Pineapple |
© TechMom | All Rights Reserved.
Designed By Template Trackers
0 comments:
Post a Comment