sql 按照某個字段分組後,再按照另外一個字段排序獲取前幾個數據

select a.* from scholars a where 4 > (select count(*) from scholars where name = a.name and quote_num > a.quote_num ) order by a.name,a.quote_num; 查找 scholars 表 並按照name分組,且每組按照quote_num大小降序,最終獲取每組quot
相關文章
相關標籤/搜索