解决办法是,将select得到的结果,再通过中间表select一遍,这样就规避了错误,这个问题只出现于mysql,mssql和oracle不会出现此问题。 MySQL根据字段删除重复值 delete from sites where id not in ( select t.max_id from (select max(id) as max_id from sites group by name,url) as t ); Oracle根据字段删除重复值 delete from sites where id not in (select max(id) as max_id from sites group by name,url) as t);
标签:删除,记录,max,sites,MYSQL,id,select From: https://www.cnblogs.com/luoyang0731/p/16898557.html