Skip to content
Advertisement

Select DISTINCT returns duplicates data Laravel 8

I’m trying to get groups that belong to a supervisor to be displayed for him. And I’m using join to get each gpid information base on supervisor_id, query its okay but returns duplicate data of the last row. I can’t figure out why it is duplicating the last record. Any help would be much appreciated.

JavaScript

Result

JavaScript

Advertisement

Answer

You can try to use groupBy instead of distinct :

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement