So I have learned that I haven't been using UNIQUE indexes in my tables like I should have, and now there are many duplicates I must delete. I did my homework on the web and pieced together the following query:
delete from notifications
where dateAdded in (select dateAdded from (
select dateAdded, uID, count(*) cnt
from notifications
where ( uID <> 0
group by dateAdded, uID
having cnt > 1 ) x
) );
Does my syntax look correct? This should, hopefully, delete all duplicate rows that have the same dateAdded and uID.
Thanks!



Reply With Quote






Bookmarks