MySQL分組排序求Top N

表結構 sql   按照grp分組,按照num排序,每組取Top 3,輸出結果以下:code     源代碼:blog SELECT * FROM score AS t3 WHERE ( SELECT COUNT(*) FROM score AS t1 LEFT JOIN score AS t2 ON t1.grp = t2.grp AND t1.num < t2.num WHE
相關文章
相關標籤/搜索