比如
select distinct * from Num//有一个表叫Num,选出num_id重复的元组
group by num_id
having count(*)>2我想批量删除这组数据,如何在一个sql语句中写出.谢谢!
select distinct * from Num//有一个表叫Num,选出num_id重复的元组
group by num_id
having count(*)>2我想批量删除这组数据,如何在一个sql语句中写出.谢谢!
from num t
where exists(
select * from num where num_id=t.num_id
group by num_id
having count(*)>2
)
delete Num where num_id in(select num_id from Num--//有一个表叫Num,选出num_id重复的元组
group by num_id
having count(*)>2)