如何删除数据库中完全一样的两天数据中的一条

来源:百度知道 编辑:UC知道 时间:2024/07/09 01:49:30
尽快啊

delete from tab where id not in select min(id)from tab where 某列=“某值”

delete from table_name
where rowid not in
(select max(rowid)
from table_name
group by col1,col2,col3....;

col1,col2,col3...是表中所有的列

先将完全一样的数据 distinct 后插入到一个临时表,
删除全部一样的数据
将临时表的数据插入到 现行表中
OK

有没有时间字段,有的话指定时间来删除