distinct list of the name field along with the fields that go with itthen your above query is wrong as you may get values of Id and description from different records.a much better option would beSELECT id,name,descriptionFROM(select ROW_NUMBER() OVER (PARTITION BY t.name ORDER BY t.id DESC) AS RN, t.id, t.name, t.description from tblTrkPhase t)tWHERE RN=1
so that you get all associated values from the same record------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs