I need a way to delete from friend_bulletin WHERE user_id AND subject have duplicates
example
user_id subject 1 test 2 test 1 test 4 dfgdf 5 dsgdsf 1 test
In the axample there are 3 duplicates 1 - test
I would like a way to do this but keep 1 of the duplicates
One way to do that is to make a copy of your table (structure only). Then set the field with duplicate values to pri key. Then copy the old table to the new one. Because pri key will not allow dups you get only one copy.
2 way: 1 something like redrun sez, but using select into new table
$sql = "INSERT INTO newtab SELECT * FROM oldtab GROUP BY user_id, subject";
The group by will elliminate the duplicates.
sorry, only one way in the absence of any unique table id