📌  相关文章
📜  错误:列“hourly_visitors.hour”必须出现在 GROUP BY 子句中或用于聚合函数 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:24.109000             🧑  作者: Mango

代码示例1
SELECT m.cname, m.wmname, t.mx
FROM (
    SELECT cname, MAX(avg) AS mx
    FROM makerar
    GROUP BY cname
    ) t JOIN makerar m ON m.cname = t.cname AND t.mx = m.avg
;

 cname  | wmname |          mx           
--------+--------+------------------------
 canada | zoro   |     2.0000000000000000
 spain  | usopp  |     5.0000000000000000