Last active
August 29, 2015 13:57
-
-
Save dalmat36/9574903 to your computer and use it in GitHub Desktop.
Multiple Gists
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
/*ROW_NUMBER() Window function assigns | |
unique incrementing integers to rows */ | |
SELECT orderid, custid, val, ROW_NUMBER() OVER (PARTITION BY custid ORDER BY val) AS rownum | |
FROM Sales.OrderValues | |
ORDER BY custid, val; |
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
stuff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment