2
code: 'ER_WRONG_FIELD_WITH_GROUP',
  errno: 1055,
  sqlMessage: "Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'fashioncart.items.item_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by",

Why do this error comes for? How can I resolve it?

Santosh Aryal
  • 1,185
  • 1
  • 15
  • 38

1 Answers1

2

This is related to the annoying 'ONLY_FULL_GROUP_BY' default setting in mysql. My advice, permanently switch it off.

mysql> SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''))

Refer this for more details: Disable ONLY_FULL_GROUP_BY

noob7
  • 454
  • 5
  • 17