I Have a table with below data
column1 column2
DIU02 3D ITEM MAINTENANCE
DIU02 DISTRIBUTION ITEM UPDATE APPLICATION
DIU02 DIU - Distribution Item Update
I want for unique DIU02 , all data come in single column using comma seperation.
Its for SQL Server Database
Below is the Query
DECLARE @Data VARCHAR(MAX)
SELECT @Data = COALESCE(@Data + ',', '') + column2
FROM Table
WHERE column1= 'DIU02'
I want to get only distinct data and I used distinct keyword but I am getting only one.
Please help !