Skip to content

Instantly share code, notes, and snippets.

@ikobi12
Created October 6, 2021 11:02
Show Gist options
  • Save ikobi12/b6bc4665524a625a9cd7f84758176e21 to your computer and use it in GitHub Desktop.
Save ikobi12/b6bc4665524a625a9cd7f84758176e21 to your computer and use it in GitHub Desktop.
[SQL] SQL
/*
If counts are more than one, then there are either duplicates or it is not the correct business key
This will also return the content of rows
*/
select *
from (
select *
, count(1) over (
partition by <BK>
) as cn
from <table>
)
where cn > 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment