tags:

views:

66

answers:

0

Hey all,

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,
-Steve