<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.strawberrymusicplayer.org/index.php?action=history&amp;feed=atom&amp;title=Find_and_delete_duplicates_from_the_collection_database</id>
	<title>Find and delete duplicates from the collection database - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.strawberrymusicplayer.org/index.php?action=history&amp;feed=atom&amp;title=Find_and_delete_duplicates_from_the_collection_database"/>
	<link rel="alternate" type="text/html" href="http://wiki.strawberrymusicplayer.org/index.php?title=Find_and_delete_duplicates_from_the_collection_database&amp;action=history"/>
	<updated>2026-05-24T14:20:46Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.38.1</generator>
	<entry>
		<id>http://wiki.strawberrymusicplayer.org/index.php?title=Find_and_delete_duplicates_from_the_collection_database&amp;diff=139&amp;oldid=prev</id>
		<title>Jonas at 23:31, 2 January 2024</title>
		<link rel="alternate" type="text/html" href="http://wiki.strawberrymusicplayer.org/index.php?title=Find_and_delete_duplicates_from_the_collection_database&amp;diff=139&amp;oldid=prev"/>
		<updated>2024-01-02T23:31:27Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:31, 2 January 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l17&quot;&gt;Line 17:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 17:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This must be done, otherwise the table used for the collection search will still have duplicates.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This must be done, otherwise the table used for the collection search will still have duplicates.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     DELETE FROM &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;strawberry.&lt;/del&gt;songs_fts;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     DELETE FROM songs_fts;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     INSERT INTO songs_fts (ROWID, ftstitle, ftsalbum, ftsartist, ftsalbumartist, ftscomposer, ftsperformer, ftsgrouping, ftsgenre, ftscomment) SELECT ROWID, title, album, artist, albumartist, composer, performer, grouping, genre, comment FROM songs;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     INSERT INTO songs_fts (ROWID, ftstitle, ftsalbum, ftsartist, ftsalbumartist, ftscomposer, ftsperformer, ftsgrouping, ftsgenre, ftscomment) SELECT ROWID, title, album, artist, albumartist, composer, performer, grouping, genre, comment FROM songs;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Jonas</name></author>
	</entry>
	<entry>
		<id>http://wiki.strawberrymusicplayer.org/index.php?title=Find_and_delete_duplicates_from_the_collection_database&amp;diff=10&amp;oldid=prev</id>
		<title>Jonas: Created page with &quot;See: https://wiki.strawberrymusicplayer.org/wiki/Accessing_the_database on how to access the database.  Exit Strawberry first and backup the file &quot;strawberry.db&quot; in case something goes wrong.  You can also use Tools / Console in Strawberry, but it won&#039;t show errors, so it&#039;s safer to use the sqlite3 command directly.  == Find duplicate songs ==      SELECT s.rowid, s.url FROM songs s INNER JOIN (SELECT url, COUNT(*) FROM songs GROUP BY url HAVING count(*) &gt; 1) d ON s.url...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.strawberrymusicplayer.org/index.php?title=Find_and_delete_duplicates_from_the_collection_database&amp;diff=10&amp;oldid=prev"/>
		<updated>2022-08-16T16:47:45Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;See: https://wiki.strawberrymusicplayer.org/wiki/Accessing_the_database on how to access the database.  Exit Strawberry first and backup the file &amp;quot;strawberry.db&amp;quot; in case something goes wrong.  You can also use Tools / Console in Strawberry, but it won&amp;#039;t show errors, so it&amp;#039;s safer to use the sqlite3 command directly.  == Find duplicate songs ==      SELECT s.rowid, s.url FROM songs s INNER JOIN (SELECT url, COUNT(*) FROM songs GROUP BY url HAVING count(*) &amp;gt; 1) d ON s.url...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;See: https://wiki.strawberrymusicplayer.org/wiki/Accessing_the_database on how to access the database.&lt;br /&gt;
&lt;br /&gt;
Exit Strawberry first and backup the file &amp;quot;strawberry.db&amp;quot; in case something goes wrong.&lt;br /&gt;
&lt;br /&gt;
You can also use Tools / Console in Strawberry, but it won&amp;#039;t show errors, so it&amp;#039;s safer to use the sqlite3 command directly.&lt;br /&gt;
&lt;br /&gt;
== Find duplicate songs ==&lt;br /&gt;
&lt;br /&gt;
    SELECT s.rowid, s.url FROM songs s INNER JOIN (SELECT url, COUNT(*) FROM songs GROUP BY url HAVING count(*) &amp;gt; 1) d ON s.url = d.url ORDER BY s.url;&lt;br /&gt;
&lt;br /&gt;
== Delete duplicate songs ==&lt;br /&gt;
&lt;br /&gt;
    DELETE FROM songs WHERE rowid NOT IN (SELECT min(rowid) FROM songs GROUP BY url);&lt;br /&gt;
&lt;br /&gt;
== Recreate FTS tables ==&lt;br /&gt;
&lt;br /&gt;
This must be done, otherwise the table used for the collection search will still have duplicates.&lt;br /&gt;
&lt;br /&gt;
    DELETE FROM strawberry.songs_fts;&lt;br /&gt;
&lt;br /&gt;
    INSERT INTO songs_fts (ROWID, ftstitle, ftsalbum, ftsartist, ftsalbumartist, ftscomposer, ftsperformer, ftsgrouping, ftsgenre, ftscomment) SELECT ROWID, title, album, artist, albumartist, composer, performer, grouping, genre, comment FROM songs;&lt;/div&gt;</summary>
		<author><name>Jonas</name></author>
	</entry>
</feed>