Answers for "sum aggregate function call with join query in laravel eloquent"

SQL
0

sql select sum group by id laravel join

$users = User::select('users*', 'analytics.*', DB::raw('SUM(analytics.revenue) As revenue'))
         ->leftJoin('analytics', 'analytics.user_id', '=', 'users.id')
         ->where('analytics.date', Carbon::today()->toDateString())
         ->get();
Posted by: Guest on July-14-2020
0

laravel join query sum example

$users = User::select('users*', 'analytics.*', DB::raw('SUM(analytics.revenue) As revenue'))
         ->leftJoin('analytics', 'analytics.user_id', '=', 'users.id')
         ->where('analytics.date', Carbon::today()->toDateString())
         ->get();
Posted by: Guest on September-24-2020

Code answers related to "sum aggregate function call with join query in laravel eloquent"

Code answers related to "SQL"

Browse Popular Code Answers by Language