Created
November 15, 2018 10:34
-
-
Save tarnagas/67b74f871ecfe7cb270e62fb3db03fb6 to your computer and use it in GitHub Desktop.
SQL MAX (LEFT JOIN alternative)
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
SELECT * FROM events | |
LEFT JOIN events as e2 ON e2.tag_id = events.tag_id | |
AND e2.change_dt > events.change_dt | |
WHERE e2.change_dt IS NULL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment