Created
October 6, 2021 11:02
-
-
Save ikobi12/b6bc4665524a625a9cd7f84758176e21 to your computer and use it in GitHub Desktop.
[SQL] SQL
This file contains 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
/* | |
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