How to group by multiple columns in Laravel Query Builder?By Hardik Savani | June 12, 2016 | | 5416 Viewer | Category : Laravel
Share this post:
Sometimes we may require to add group by with multiple columns, if we have mysql query then we can do it easily by using sql query. But if you want to give multiple columns in groupBy() of Laravel Query Builder then you can give by comma separated values as bellow example.
$data = DB::table("items_count")
,DB::raw("SUM(items_count.quantity) as total_quantity"))
- How to integrate paypal payment gateway with laravel 5.4
- Fixed - MassAssignmentException in model.php laravel 5?
- How to get last executed query in Larave 5?
- How to count number of files in directory PHP?
- Fadein Fadeout example in Jquery
- Multiple database connections in laravel 5 Application
- AngularJS - how to remove html tags using filter?
- How to make simple dependent dropdown using jquery ajax in Laravel 5?