select distinct name from table
打开不重复记录的单个字段
select * from table where fid in(Select min(fid) FROM table group by name)
打开不重复记录的所有字段值
select * from table where name in(select name from table group by name having count(name)=1)
打开不重复任意次数的所有记录
第一用 distinct
第二用 group by 分组
我觉得下面回复中
“select * from table where name in(select name from table group by name having count(name)=1)
打开不重复任意次数的所有记录”
有问题 ,你需要查询全部的username ,而且username还不能重复,他这种回复是将重复的去掉了不包括重复的记录 ……
加上 DISTINCT 这个是去掉重复记录的。
第一用 distinct
第二用 group by 分组