您好,请问在这个sql中,where条件没太明白~
delete t1 from tdb_goods as t1 left join (select goods_id ,goods_name from tdb_goods group by goods_name having count(goods_id) >= 2) as t2 on t1.goods_name = t2.goods_name where t1.goods_id > t2.goods_id;
这个语句是例子中得例子,也可以执行成功,但是where t1.goods_id > t2.goods_id;有点儿看不太懂~去除重复只能通过id大小判断嘛?还有别的写法可以分享嘛?