I need to be able to bring back records from an SQL stored procedure and display them. but I do not want to show duplicates.
I have stored a procedure that brings back all records where ID = the selected ID. It then displays something like this
| id | value |
|---|---|
| 12 | 34 |
| 12 | 34 |
| 12 | 33 |
| 12 | 33 |
I need to bring back only one occurence where ID = 12 and value = 33, and one occurence where ID = 12 and value = 34
I'm working in a PHP laravel framework, I know that
DB::selectOne will bring back a single column, and that DB::select will bring back all records. Is there a laravel/PHP function that will bring back records and will only show one of each value? like so:
| id | value |
|---|---|
| 12 | 34 |
| 12 | 33 |