select * from mhxy, (select max(id) as id from mhxy group by name ) t where t.id = mhxy.id order by name