Created
March 8, 2023 22:17
-
-
Save mikehins/472bc7897a588b254183cca189437e3f 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
SELECT t.my_column_1, t.my_column_2 | |
FROM ( | |
SELECT *, | |
ROW_NUMBER() OVER (PARTITION BY my_column ORDER BY my_column_2 DESC) AS row_num | |
FROM my_table | |
) t | |
WHERE t.row_num = 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment