Similar to whereRaw() I'd welcome an option to set the value for SELECT manually.
What I currently try to achieve is multiple SUM()s in one query.
The query builder has a sum() method, but this gives only one result and I would have to do almost the same query multiple times.
Something like DB::select('SUM(x) as x', 'SUM(y) as y') unfortunately does not work, because the select values get surrounded by backticks.
To be fair, I didn't realise I could use DB::select(DB::raw('…')), but maybe a selectRaw() would be easier/shorter. But it's definitely not urgent.
Maybe the raw thing should be in the magic method instead of having to define a raw variant of each grammar component.
Good point.
Done.
Most helpful comment
Done.