There are fields id, name, age in table T (Note: id has the same value) Query data records with the same id and greater than 1
select * from T a where exists (select id from T where id=a.id group by id having count(*)>1)
If you need to query for the existence of the same value for name, replace id with name.