Thursday, February 27, 2014

Get distinct records if more than one select column

Looks like this to me



SELECT ParentId,refid,TaskNo,TaskOwner,UpdatedBy,Remarks,Description
FROM
(
SELECT *,ROW_NUMBER() OVER (PARTITION BY ParentId ORDER BY refid) AS Seq
)t
WHERE Seq =1





Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://ift.tt/19nLNVq http://ift.tt/1iEAj0c


No comments:

Post a Comment