Skip to content

Instantly share code, notes, and snippets.

@wriglz
Last active January 24, 2020 14:30
Show Gist options
  • Save wriglz/a06d6982ab7d08b939d418448f6880f2 to your computer and use it in GitHub Desktop.
Save wriglz/a06d6982ab7d08b939d418448f6880f2 to your computer and use it in GitHub Desktop.
WITH data AS
(SELECT column_to_test,
count(*) OVER (PARTITION BY column_to_test), other_columns_to_output
FROM schema.table )
SELECT *
FROM data
WHERE count > 1
ORDER BY column_to_test;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment