Created
June 18, 2013 14:49
-
-
Save fmariluis/5805985 to your computer and use it in GitHub Desktop.
Create unique id field for a view in PostgreSQL
This file contains hidden or 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 | |
( SELECT | |
ROW_NUMBER() OVER (ORDER BY column_to_sort_by ASC) AS ROW_NUMBER, | |
Col1, Col2 | |
FROM table_name | |
) myview_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment