2 years ago

Query builder

Posted 2 years ago by adnan483

How to make this query with QueryBuilder or what?

SELECT duznici_2018.*,sum(rate_2018.rata) as ukupno FROM duznici_2018 LEFT JOIN rate_2018 ON duznici_2018.duznikID=rate_2018.duznikID  GROUP BY duznikID DESC

I'm stuck on how to add SUM:

$sumrate = DB::table('duznicis')->leftJoin('rates', 'duznicis.kupac_id', '=', 'rates.duznik_id')->get();

Please sign in or create an account to participate in this conversation.