Mysql max 查询最大记录所在行数据

首先,查找某字段的最大值app

select max(weight) from apple;


接着,根据最大值,查找其所在行
 code

select * from apple where weight =7888;

合并在一块儿就是select

select * from apple where weight = (select max(weight) from apple);
相关文章
相关标签/搜索