fjtello / SQL-C-sharp

Common programming and coding tips and howtos
0 stars 0 forks source link

SQL #CONCAT #STRING_AGG concatenate #55

Open fjtello opened 1 year ago

fjtello commented 1 year ago

SELECT REPLACE(CONCAT('"',STRING_AGG(element, '","'),'"'), '"', '''') As stringofallelements FROM table

table

element1 element2

==> res: 'element1', 'element2'