Error Code:1140 sum group by

Error Code: 1140. In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column ‘sys.yearsales.City’; this is incompatible with sql_mode=only_full_group_by

You can use the aggregate AVG only by using the GROUP BY:
SELECT country.continent, ROUND(AVG(city.population), 0) AS c
FROM city,country
WHERE city.countrycode = country.code
GROUP BY country.continent;

    原文作者:ChengchengHuang
    原文地址: https://www.jianshu.com/p/8d00ce874a38
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞