sql 删除同一个表中的重复数据

2024-12-31 22:06:33
推荐回答(2个)
回答1:

delete
from
table
where
id
not
in
(select
min(id)
from
table
group
by
其他字段
)

回答2:

delete
from
table
where
rowid
not
in
(select
min(rowid)
from
table
group
by
分区字段
)