一、Sql 查询最新十条数据 select * from 表名 order by id(主键) desc limit 10 示例: SELECT * FROM gold_value.chow_tai_fook order by id desc limit 10; 返回结果 : 二、Sql 查询最新十条数据并按时间排序 SELECT * FROM (select * from 表名
1、sql 语法 select m, nfrom (select row_number () over (partition by m order by n desc) rn,--以m分组,分组内以n倒序排列求每组中各自的序号m, nfrom tablewhere ...) wwhere w.rn <=10;序号小于10order by m, n desc 2、案例获取每个月前十大