I have a function to remove the duplicate in one of my table but I cant seem to be able to ORDER the way mysql select the values.
Here is my initial table:

Code: Select all
mysql_query("CREATE TABLE new_table as SELECT * FROM test GROUP BY url")
mysql_query("DROP TABLE test")
mysql_query("RENAME TABLE new_table TO test")
The good result should be that the 3 values (a,b,c) with a PR of 6 are found in the final table.
I tried this and it doesnt work:
Code: Select all
mysql_query("CREATE TABLE new_table as SELECT * FROM test GROUP BY url ORDER BY pr DESC")