Blog

Get comma separated value from a column

Posted by Sandeep Singh Shekhawat Blogs | SQL Dec 01, 2012
In this blog I am going to explain that how can get comma (,) separate values from a column

In this blog I am going to explain that how can get comma (,) separate values from a column. For example aa,dd,cc etc . So here is point to point explain.

  1. Create a Table

First of all I am creating a table which contains direction so here table is “DIRECTION” .

table.png

2. Insert values

Here we are going to inserting directions in table.

insertdirection.png

3. Get all data

showdata.png

4. Get comma separated values by concat strings

concat.png

OUTPUT

output.png

5.   Get comma separated values using COALESCE function

coalesec.png

Here we get same output as point no 4.

post comment
     
COMMENT USING
PREMIUM SPONSORS
DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.
Join a Chapter
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.