Quantcast
Channel: User zarpio - Stack Overflow
Viewing all articles
Browse latest Browse all 39

Laravel 5.6 chunk with groupBy

$
0
0

I am getting the error while executing below, while without groupBy it is working fine.

    User::select('col')->groupBy('col1')->chunk(100, function ($users) {        foreach ($users as $user) {            dump($user);        }    });

Error:

SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column

Viewing all articles
Browse latest Browse all 39

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>