Answers for "must appear in the GROUP BY clause or be used in an aggregate"

SQL
1

postgresql must appear in the group by clause or be used in an aggregate function

Try using "DISTINCT" instead of "GROUP BY"
Posted by: Guest on January-27-2021
0

column 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 November-06-2021

Code answers related to "must appear in the GROUP BY clause or be used in an aggregate"

Code answers related to "SQL"

Browse Popular Code Answers by Language