1、表中存在完全重复的数据,即所有字段内容都是相同的,或者所需要查询的字段完全重复
select distinct * from tablename;
2、表中存在部分数据重复的字段,即重复数据中至少有一个字段不重复
select * from t a where not exists
(select 1 from where a.id = id a.name = name and a.length < length);
1、表中存在完全重复的数据,即所有字段内容都是相同的,或者所需要查询的字段完全重复
select distinct * from tablename;
2、表中存在部分数据重复的字段,即重复数据中至少有一个字段不重复
select * from t a where not exists
(select 1 from where a.id = id a.name = name and a.length < length);
© 著作权归作者所有