How to Find Duplicate Movies in Kodi: Show all duplicated rows in table SQL SQLite

How to Find Duplicate Movies in Kodi: Show all duplicated rows in tables using SQL & SQLite

Here are some very simple ways to find and remove all of your duplicate movies in SQL and SQLite:

THIS FINDS ALL duplicate movies in Kodi but doesn’t list each duplicate row:

SELECT c00,  uniqueid_value, COUNT(uniqueid_value) AS NOofDups
FROM movie_view
GROUP BY uniqueid_value
HAVING ( COUNT(uniqueid_value) > 1 )
ORDER BY
c00 ASC;

 

The results will look like so:


how to find duplicate movies in kodiClick to enlarge

 
This will display all of your duplicated movies in Kodi as rows with path and filename included (using the example from above):

SELECT movie_view.[uniqueid_value], movie_view.[c00], movie_view.[strPath], movie_view.[strFileName]
FROM movie_view
WHERE (((movie_view.[uniqueid_value]) In (SELECT [uniqueid_value] FROM [movie_view] As Tmp GROUP BY [uniqueid_value] HAVING Count(*)>1 )))
ORDER BY movie_view.[c00], movie_view.[uniqueid_value];

 
 

The results will look like so:


show kodi movies duplicated rows in sql and sqliteClick to enlarge

 
 
And this is just a generic template for you to use with SQL and SQLite for any other table you want display duplicate rows:

SELECT TABLE1.[FIELD1], TABLE1.[FIELD2], TABLE1.[FIELD3], TABLE1.[FIELD4] ←{You can add more fields here if you like}
FROM TABLE1
WHERE (((TABLE1.[FIELD1]) In (SELECT [FIELD1] FROM [TABLE1] As Tmp GROUP BY [FIELD1] HAVING Count(*)>1 )))
ORDER BY TABLE1.[FIELD2], TABLE1.[FIELD1]; ←{You can change the order here if you like}

 
 

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *