3
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,276
  • 1
  • 18
  • 41
Arshak Ahamed
  • 73
  • 1
  • 8

1 Answers1

5

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
  • 820
  • 9
  • 18