Simple Machines Community Forum

General Community => Scripting Help => Aiheen aloitti: lawyersguide - syyskuu 12, 2008, 02:14:10 IP

Otsikko: MYSQL compare rows for duplicates and remove certain ones
Kirjoitti: lawyersguide - syyskuu 12, 2008, 02:14:10 IP
We have a table with rows and we want to remove certain rows that are duplicates for example:

I want to find all F3's  that match, and where there is a match, remove those rows where F2 does not equal 2; result should remove R1 and R2...and the rest remain


        F1      F2       F3
R1   608    21       484
R2   718    16       484
R3   708      2       484
R4   608    21       500
R5   718    16       510
R6   708      2       600

Thanks you
Otsikko: Re: MYSQL compare rows for duplicates and remove certain ones
Kirjoitti: Adish - (F.L.A.M.E.R) - syyskuu 18, 2008, 02:27:21 IP
use restore_backup.php.. it will do the needful automatically.. ;)