select * from students where id in(SELECT max(id) FROM `students` group by name having count(name)>1)