Last active
April 13, 2018 17:35
-
-
Save gitcheckoutnikhil/d054f0d063572bb24c0365eb7b855533 to your computer and use it in GitHub Desktop.
window function
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
--first value | |
first_value(country_id) | |
over(partition by user_id order by row_date | |
rows between unbounded preceding and unbounded following) as country_id, | |
--rank | |
rank() | |
over(partition by user_id order by view_date) as rank, | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment