Created
April 12, 2018 00:39
-
-
Save ilovejs/c26e158ca22d9a324137a6f2369cee82 to your computer and use it in GitHub Desktop.
histogram_in_pg.sql
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 | |
x, | |
WIDTH_BUCKET(x, 1, 10, 9) AS "x In Which Bucket ?" | |
FROM | |
generate_series(1, 10) x; | |
SELECT | |
ROW_NUMBER() OVER(), | |
* | |
FROM | |
generate_series(1, 10) x; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment