Last active
December 22, 2021 09:39
-
-
Save Mr--John-Doe/ef1c1bb8315554f66e72303b482d75ba to your computer and use it in GitHub Desktop.
Filter the last row of a query
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 * | |
, ROW_NUMBER() OVER (PARTITION BY client ORDER BY sale_date DESC) AS rownum_desc | |
FROM sales_table | |
QUALIFY rownum_desc = 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment