Receiving the following error:
Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'world.country.Code' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
When running the following query:
select countrylanguage.language, country.code, sum(country.population*countrylanguage.percentage/100)
from countrylanguage
join country on countrylanguage.countrycode = country.code
group by countrylanguage.language
order by sum(country.population*countrylanguage.percentage) desc ;
Using the MySQL world test database (http://dev.mysql.com/doc/index-other.html). No idea why this is happening. Currently running MYSQL 5.7.10.
Any ideas??? :O
country.code
is not in yourgroup by
statement, and is not an aggregate (wrapped in an aggregate function).https://www.w3schools.com/sql/sql_ref_sqlserver.asp