Skip to content

Instantly share code, notes, and snippets.

@vincentdesmares
Created May 12, 2017 00:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vincentdesmares/81a359af69a6f4b90bb87327aaca0cc5 to your computer and use it in GitHub Desktop.
Save vincentdesmares/81a359af69a6f4b90bb87327aaca0cc5 to your computer and use it in GitHub Desktop.
SELECT
*,
count(*)
OVER report_by_category AS count,
count(*)
OVER (report_by_category
ORDER BY salary) AS ordered_count
FROM
employe
WINDOW
report_by_category AS (
PARTITION BY
category
)
LIMIT 5;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment