Open eliacimdavila opened 5 years ago
The issue is that MySQL has ONLY_FULL_GROUP_BY on my default in newer versions. Not sure what to suggest to fix this other than to rewrite the query.
I added this to get past it, but this probably needs to be fixed the right way. I'm not that strong in the ways of SQL, or I would make a PR:
DB::statement("SET SESSION sql_mode = ''");
I added this to get past it, but this probably needs to be fixed the right way. I'm not that strong in the ways of SQL, or I would make a PR:
DB::statement("SET SESSION sql_mode = ''");
Hello @incraigulous , This totally works by default for the latest systems. Create some tests for the older systems and or Database Switching (aka Mysql, Mongo, etc). Create a config for that utility statement to be executed.
Please have your worth credit and shoot a PR to make necessary changes and configurations.
Thanks for the workaround.
It should be worth noting that ONLY_FULL_GROUP_BY makes MySQL better comply with SQL standards. It's probably better to re-write your query.
sql_mode = ''
actually clears all the SQL modes currently enabled. That may not necessarily be what you want. See this Stack Overflow question for more options.
I added my fields to an array and referenced that array in my select and groupBy which seems to have fixed the problem for me.
In Laravel I have set the db config strict value to false.
Hi, I am using the extension and is working whithout problem on mysql. But, when I change to SQL Server connection, it throws me this error:
My code is something like this:
The query that is generated is:
I think the problem is this part:
Because is the only part with GROUP BY statement.
Is something I can do to fix this?
Thanks.