select t1.id, t1.nombre from tabla t1 inner join tabla t2 on t2.id <> t1.id and t2.nombre = t1.nombre order by t1.id