我通常这样做,但后来我发现这样做有错误:
DELETE FROM pms_log_sms
WHERE id NOT IN (
SELECT DISTINCT id FROM (
SELECT MAX(id) AS id FROM pms_log_sms
GROUP BY username,`time`,text
HAVING COUNT(*) > 0 ) A
);
我的桌子有:
unique id (autoincre), username, text, time
文本编码例如:
record 1:
//FuxOBtL8Lmop0Az943oBNWSTvUYSk8+euJWKgMJHk=
and record 2:
//FuxOBtL8Lmop0Az943oDB+aoIMJXdTltYQJ1j0TbRARwwCIZiwIwovq8LrgYtV
查询会发现这些是重复的并删除它们但是它们不是同一个文本,有时它们同时发布,但是diff唯一ID,相同的用户名但查询会发现这些是重复数据并删除它们但是它们不是同一个文本
任何解决方案?