mysql> show database;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database' at line 1
mysql>
DELETE t1 FROM tdb_goods AS t1 INNER JOIN (SELECT * FROM tdb_goods GROUP BY goods_name HAVING count(goods_name)>=2) AS t2
-> ON t1.goods_name=t2.goods_name WHERE t1.goods_id>t2.goods_id;
我是这样搞的,测试了可行。不知道有没有BUG,使用的是INNER JOIN