不能先select出同一表中的某些值,再update这个表(在同一语句中)
解决方案
--1.把需要删除的数据放到另外的一张表里
create table table_test as select oneName from one
group by OneName,OneAge,oneSex,oneAddress having count(oneName) > 1;
--2.删除不需要的数据
delete from one where onename in(select oneName from table_test);
--3.删除创建的表
drop table table_test;
不可以在查询表的同时操作这张表 mysql所限