Error Code: 1140. In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column 'dbname.a.column_name'; this is incompatible with sql_mode=only_full_group_by
In order to resolve this issue, we have to turn off ONLY_FULL_GROUP_BY sql_mode.
- Check sql_mode by issue this command:
SELECT @@sql_mode;
- You'll see the output like below:
ONLY_FULL_GROUP_BY
- Now turn off the ONLY_FULL_GROUP_BY by issuing this command:
SET sql_mode = '';