Thursday, 15 December 2011

Delete Duplicate Rows Example

Delete A FROM (
     SELECT ROW_NUMBER()OVER(PARTITION BY PatientId ORDER BY LASTMODIFIEDDATE   DESC) RANK1,PatientId
     FROM TblPatient WHERE CenterId = 10 ) A  WHERE RANK1 > 1

No comments:

Post a Comment