Nilesh Purohit

get comma separated result in sql

Table: A

ID | NAME

1 | ABC

2 | PQR

3 | XYZ

OP

ABC,PQR,

select substring((select ‘, ‘ + name from A where id in (1,2) FOR XML PATH(”)),1,10000);

Next Post

Previous Post

© 2018 Nilesh Purohit

Theme by Anders Norén