Here it is.
id
group_id
song_title_id
Song_title_id relates to:
id
song_title
In the first table, there can be multiple instances of the same song_title_id. And when results are returned, I want there to only one instance of each song_title_id in the results.
Previously, I'd have done:
DB::table('group_songs')
->groupBy('song_title_id')
->get();
Since updating to PHP 7, I get an error:
Syntax error or access violation: 1055 '[table/column name]' isn't in GROUP BY
That was when I typed it here. This is happening everywhere I use groupBy.
Can anyone help me with this groupBy problem? Is there an alternate way to select unique columns? Or is there something wrong with my query above?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community