sql查询表中字段值相同的数据记录

查询A表中id的值相同的数据

select * from A a where exists (select id from A where id=a.id group by id having count(*)>1) ORDER BY id

posted @ 2017-03-16 15:22  名尚  阅读(1767)  评论(0)    收藏  举报