Avg of a Sum in one query
I think your question needs a bit of explanation. If you want to take the sums grouped by t.client you can use: SELECT t.client, SUM(t.asset) FROM the-table t GROUP BY t.client Then, if you want to take the average of this sume, just make: SELECT AVG(asset_sums) FROM ( SELECT t.client, SUM(t.asset) AS asset_sums FROM the-table … Read more