Created
April 8, 2023 14:12
-
-
Save joekolade/c5657f4bfe682c284940dea11455b85a to your computer and use it in GitHub Desktop.
[DB Find duplicates in multiple fields]
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 c.uid as "CE uid", c.pid as "CE pid", uid_foreign, uid_local, count(*) as NumDuplicates | |
| FROM sys_file_reference s | |
| JOIN tt_content c ON (c.uid = s.uid_foreign) | |
| WHERE s.tablenames = "tt_content" | |
| AND s.deleted = 0 | |
| AND c.deleted = 0 | |
| GROUP BY uid_foreign, uid_local | |
| HAVING NumDuplicates > 1 | |
| #ORDER BY c.pid ASC | |
| ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment