更新时间:2023-01-29 21:19:03
With
SELECT award, pi, org FROM tbl WHERE groupby(award) LIMIT 20
你会得到 SQL 错误 (1305): FUNCTION xxx.groupby 不存在
您需要以下代替,假设 pi
单独是唯一的,并且 org 在同一个表中(非规范化)
You need the below instead, assuming pi
alone is unique, and org is in the same table (denormalised)
SELECT pi, org, count(award) awardcount
FROM tbl
GROUP BY pi, org
ORDER BY awardcount DESC
LIMIT 20;