How would you best handle constructing this SQL statement in SubSonic?
SELECT ac.*
, SUM(pt.amount) AS 开发者_如何转开发totalPoints
FROM tbl_account AS ac
INNER JOIN tbl_pointTracking AS pt ON ac.id = pt.accountID
GROUP BY pt.accountID
ORDER BY totalPoints DESC;
I know how to handle aggregates, but not sure how to handle aggregates with other columns.
Thanks all,
-SteveHere is the code which will help you to do so.
gvGroup.DataSource = office.DB.Select(SubSonic.Aggregate.GroupBy("Designation"), SubSonic.Aggregate.Count("Designation")).From(Of office.Employee).ExecuteDataSet
gvGroup.DataBind()
精彩评论