searchable icon indicating copy to clipboard operation
searchable copied to clipboard

Forge + This Package: SQLSTATE[42000]: Syntax error or access violation: 1463 Non-grouping field 'relevance' is used in HAVING clause

Open sheyworth opened this issue 8 years ago • 7 comments

I have tried turning off MYSQL Strict Tables mode and still get the same issue.

sheyworth avatar May 23 '16 22:05 sheyworth

1+

erikrorstrom avatar Sep 30 '16 15:09 erikrorstrom

L5.3 has strict mode set to true by default. Check in config/database.php and try:

'strict' => false,

simplethemes avatar Oct 14 '16 02:10 simplethemes

@simplethemes Thanks! That did it.

erikrorstrom avatar Oct 18 '16 16:10 erikrorstrom

even after disabling strict mode in laravel I have the same issue

Illuminate\Database\QueryException with message 'SQLSTATE[42000]: Syntax error or access violation: 1055 'financetest1.customers.first_name' isn't in GROUP BY (SQL: select * from (select customers.*, max((case when LOWER(customers.first_name) LIKE s then 150 else 0 end) + (case when LOWER(customers.first_name) LIKE s% then 50 else 0 end) + (case when LOWER(customers.first_name) LIKE %s% then 10 else 0 end) + (case when LOWER(customers.last_name) LIKE s then 150 else 0 end) + (case when LOWER(customers.last_name) LIKE s% then 50 else 0 end) + (case when LOWER(customers.last_name) LIKE %s% then 10 else 0 end) + (case when LOWER(customers.id) LIKE s then 120 else 0 end) + (case when LOWER(customers.id) LIKE s% then 40 else 0 end) + (case when LOWER(customers.id) LIKE %s% then 8 else 0 end)) as relevance from customerswherecustomers.deleted_atis null group bycustomers.idhaving relevance >= 7.00 order byrelevancedesc) ascustomerswherecustomers.deleted_at is null)'

SapneshNaik avatar Apr 09 '17 16:04 SapneshNaik

@SapneshNaik i have same issue

muhajirinlpu avatar May 02 '17 13:05 muhajirinlpu

I had the same issue with some fields not being part of the GROUP BY. By setting up strict mode to false, it fixes the issue. Thanks!

vdellangela avatar May 29 '17 03:05 vdellangela

thanks sir, i have same problem and to change config/database.php mysql "strict => false" 👍

hung-f avatar Jan 22 '18 14:01 hung-f