若是数据库中有两条或多条重复的数据【刨掉重复数据,重复数据只显示一条用 distinct 关键字】数据库
查询语句:select t.*, t.rowid from mytest t;test
使用distinct后语句:select distinct id,name,price,kucun,isbn from mytest;select
这滤掉了一条彻底重复的数据语法
若是是想保留重复数据的一条im
使用语句语法:delete from t where rowid not in (select min(rowid) from t group by 去重字段);数据
语句:delete from mytest where rowid not in (select min(rowid) from mytest group by isbn);查询
结果显示:img
这会的数据只保留了重复要去重字段的一条数据,其余的数据都已经删除了!di