MySQL语句错误及解决方案

1.group by查询错误

ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'qzs.person.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

具体参看我的博客文章:MySQL错误1055

不改变环境的条件下,可用

$ select gender from person group by gender;

进行分组查询,但结果只能查询gender这一个字段。

原文地址:https://www.cnblogs.com/haoyul/p/10416930.html