Combine Common in Comma separated row


 SELECT taf_no,
SUBSTRING((SELECT ','+ CAST(dtafdet_from AS VARCHAR)+','+dtafdet_to

            FROM CTE B

            WHERE A.taf_no = B.taf_no

            FOR XML PATH('')

             ),2,100)As Temp
           
           
FROM CTE A
GROUP BY A.taf_no

Comments

Popular posts from this blog

TSQL To Get All the Names of tables and Databases whose data have changed in last 24 Hours

To Get All the Names of tables and Databases their data have changed in last 24 Hours And Backup those databases

Apply paging in procedure