Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ER_WRONG_FIELD_WITH_GROUP

Tags:

node.js

mysql

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?

like image 830
Arshak Ahamed Avatar asked Oct 19 '25 04:10

Arshak Ahamed


1 Answers

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

like image 117
noob7 Avatar answered Oct 21 '25 17:10

noob7



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!