Search
 
SCRIPT & CODE EXAMPLE
 

SQL

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
Comment

PREVIOUS NEXT
Code Example
Sql :: tsql default value when no value returned by query 
Sql :: mysql let join 
Sql :: sql server: how to assign value to table variable returned from function 
Sql :: mysql does collate nopad recognize space 
Sql :: mysql user set plugin 
Sql :: sql insert multiple rows from another table 
Sql :: compute age mysql 
Sql :: sqlcl format 
Sql :: select from another database 
Sql :: oracle list subpartitions 
Sql :: dump a single table named mytab 
Sql :: SQL FULL OUTER JOIN With AS Alias 
Sql :: ms sql convert hijri to gregorian 
Sql :: enter postgres shell o localhost 
Sql :: postgresql custom order by 
Sql :: sqlalchemy query return only n results 
Sql :: oracle update multiple columns 
Sql :: apikey in pl sql 
Sql :: bus source and destination equal to destination and source of another by sql query 
Sql :: codeigniter 3 get best-selling products 
Sql :: basic sql queries interview questions 
Sql :: calcular edad en oracle 
Sql :: Pattern Sql Rlike same as REGEXP 
Sql :: Mysql Install Ubuntu with native password 
Sql :: selects all the columns from the sailors table 
Sql :: Mysql select all where count more than" 
Sql :: create more than 1 tables with references to each other in sqlite3 
Sql :: get employees if not contains in sql 
Sql :: lost connection to mysql 
Sql :: convert mongodb to sql 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =