4个回答
展开全部
1、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断
select * from people
where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1)
例二:
select * from testtable
where numeber in (select number from people group by number having count(number) > 1 )
可以查出testtable表中number相同的记录
具体可以参考下我这篇文章,不清楚的也可以后面留言:http://www.ttasp.net/article/3/14/201405/115.html
select * from people
where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1)
例二:
select * from testtable
where numeber in (select number from people group by number having count(number) > 1 )
可以查出testtable表中number相同的记录
具体可以参考下我这篇文章,不清楚的也可以后面留言:http://www.ttasp.net/article/3/14/201405/115.html
展开全部
你的意思就是 不显示 重复数据吧?
select distinct 字段 from table
select distinct 字段 from table
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
select distinct 某字段,字段1,字段2 from table where 字段x=条件x order by id desc
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
select distinct strname from table
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询