Hai All,
I came in a situation to get the result of tables in in raw form to a column form with comma separated
ID | Data |
| 1 | abc |
| 2 | pqr |
| 3 | xyz |
Suppose to get the data from tbl_Sample as
Output |
| abc,pqr,xyz |
SELECT STUFF((SELECT ', ' + RTRIM(Data) FROM tbl_Sample FOR XML PATH('')),1,1,'') AS 'Output'
Hope this may help you in some situations
Thanks
0 comments:
Post a Comment