blob: e3625eed0e419adf2a15fb8d7f6c18b30dbcb2ca (
plain)
1
2
3
4
5
6
7
8
9
10
|
-- Add index on guid for deduplication
CREATE INDEX IF NOT EXISTS idx_articles_guid ON articles(guid);
-- Remove duplicate articles by guid, keeping only the one with the smallest id
DELETE FROM articles
WHERE id NOT IN (
SELECT MIN(id)
FROM articles
GROUP BY guid
);
|