I have a table called SampleData which looks like this:
 col1    col2     
    1       a       
    1       b       
    1       c      
    2       d       
    2       e
    3       f
I need the data in the below format:
col1    col2     
1       a,b,c           
2       d,e       
3       f
Is there a way of doing this using CTE as well?
 
     
    