I’d like to GroupBy and get a Count, but in a SelectMulti setting.
Example, I’m joining three tables, and grouping by a column on T3. I’d like to count that column.
var q = db.From<T1>().Join<T2>(...).Join<T3>()
.GroupBy<T1,T2,T3>((t1,t2,t3)=>new {t1,t2,t3.Status})
Then finally
var results = db.SelectMulti<T1,T2,T3>(q.SelectDistinct())
This gives me what you’d expect from a SQL
SELECT t1.*, t2.*, t3.Status
group by ALL T1'S COLUMNS, ALL T2'S COLUMNS, T3.STATUS
But I’d like to have a Count aggregate, like I’d have from this SQL:
SELECT t1.*, t2.*, t3.Status, Count(*)
group by ALL T1'S COLUMNS, ALL T2'S COLUMNS, T3.STATUS
How can this be achieved?