Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
GeXus
Forum Regular
Posts: 631 Joined: Sat Mar 11, 2006 8:59 am
Post
by GeXus » Thu Jan 25, 2007 3:16 pm
I have a table with a bunch of duplicate data that I want to delete there are too many to do one by one, is there anyway to do this outside of using temp tables?
Burrito
Spockulator
Posts: 4715 Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah
Post
by Burrito » Thu Jan 25, 2007 3:25 pm
it depends on what dbms you're using (version and type).
you could sub query for duplicates using a HAVING clause and then delete with a limit of 1.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Jan 25, 2007 3:35 pm
Self-joins can be used too.