Last active
December 27, 2015 02:59
-
-
Save mmilleruva/7256622 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE FROM PROPERTY_MANAGER | |
WHERE PERSON_ID NOT IN ( | |
SELECT PERSON_ID | |
FROM( | |
select *, | |
ROW_NUMBER() OVER | |
( | |
partition by PROPERTY_ID | |
order by UPDATE_DATE desc | |
) AS ROW_NUM | |
from PROPERTY_MANAGER | |
) foo | |
WHERE ROW_NUM = 1 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment