比如type 有3個型別,然后查詢結果根據type 分組,根據 date 排序(每個型別資料的date可能相同),然后怎么查出,每個型別的前10條資料(每個型別資料根據時間降序)
uj5u.com熱心網友回復:
e.g.select * from (select *,row_number()over(partition by type order by date) as RN from tabName)as T where RN<=10;
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/144643.html
標籤:疑難問題
上一篇:MySQL
下一篇:求sql陳述句
