select max(id) id,name from 表 group by name --如果表中还有其他字段要查出,那么 select * from 表 where id in (select max(id) from 表 group by name )
select max(id) id,name from 表 group by name --如果表中还有其他字段要查出,那么 select * from 表 where id in (select max(id) from 表 group by name )
转载于:https://www.cnblogs.com/readstory/articles/7131064.html