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
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