第1个回答 推荐于2018-02-28
1)
select *
from tab t
where exists (select 1 from tab where id = t.id and (name <> t.name or age <> t.age)
2)
select *
from tab
where id in (select id from tab group by id having count(*) > 1)本回答被提问者和网友采纳
第2个回答 2012-08-04
首先你说的重复是说id重复还是所有字段重复?select * from tablename group by id having count(*)>1。把id字段换成你认为是重复字段即可,如果是所有字段,则把所有字段写上去。
第3个回答 2012-08-04
像你给数的例子这样就可以了。
select distinct id,name,age from 表名 ;