View Single Post
Old 02-22-2013, 10:11 PM   PM User | #14
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,556
Thanks: 62
Thanked 4,055 Times in 4,024 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Yes, if you added that AUTO_INCREMENT field.

Say you named it "uniqueid".

Then:
Code:
DELETE t1 
FROM tablename AS t1, tablename AS t2
WHERE t1.lnktxt = t2.lnktxt
  AND t1.cattxt = t2.cattxt
  AND t1.datetxt = t2.datetxt
  AND t1.uniqueid < t2.uniqueid
But run the other query first, so that you get rid of the ones that *DO* differ by date. And only then run this one as a sort of cleanup.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Users who have thanked Old Pedant for this post:
mharrison (02-22-2013)