Answers for "ERROR: column "hourly_visitors.hour" must appear in the GROUP BY clause or be used in an aggregate function"

SQL
0

ERROR: column "hourly_visitors.hour" must appear in the GROUP BY clause or be used in an aggregate function

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
Posted by: Guest on September-20-2021

Code answers related to "ERROR: column "hourly_visitors.hour" must appear in the GROUP BY clause or be used in an aggregate function"

Code answers related to "SQL"

Browse Popular Code Answers by Language