[Mysql]查询优化

2020/09 18 15:09

只查询前N个记录的数据

select id from tablename where id in (select id from ( select id from tablename order by id desc limit 10) as id );

// 即从tablename中取前10个,再查询