Closed
Description
It doesn't seem possible to have a SUM
in a SELECT
column list together with other columns (unless you hardcode it with SelectRaw
), is this correct?
Consider this query:
SELECT GroupId, SUM(Age)
FROM People
GROUP BY GroupId
I can only find AsSum
on the query object, but this makes it only select a SUM
, and discards any other columns that have been selected with Select()
.
It also requires an alias on the SUM
, but that's a minor thing.
Here's an example in MySQL.
Metadata
Metadata
Assignees
Labels
No labels