56,687
社区成员
发帖
与我相关
我的任务
分享
create table temp(id,uid,name)
insert into temp
select *
from user u1
where uid=2 and name='wn' and not exists (select 1 from user where uid=2 and name='wn' and u1.id>id)
delete from user where uid=2 and name='wn'
insert into user
select *
from temp
delete a
from user a,(select count(*) as cnt from user where uid=2)b
where a.uid=2 and a.name='wn' and b.cnt>=2