方案一:distinct
select distinct name from table
方案二:group by
select min(fid),name,sex from table group by name
方案三:
select * from table where name in(select name from table group by name having count(name)=2)
以上三个语句,能将sql数据库里不重复的信息筛选出来。
select t.* from 表 twhere exists(select * from 表 a where a.第二列 = t.第二列 group by a.第二列 having count(a.第二列) = 1)
你测测吧,给个采纳就行了。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)