select * from class c1,(select name,count(name) from class group by namehaving count(name)>1) c2where c1.name = c2.name