解决方案 --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.删除创建的表dro...
mysql中删除数据不可以用子查询吗?
不能先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;2014-11-27
不可以在查询表的同时操作这张表 mysql所限2014-11-27