If I have the following table:
Table "users"
Column | Type | Modifiers
---------------+------------------+-----------
id | integer |
monthly_usage | real[] |
Where monthly_usage
is an array of 12 numbers, i.e. {1.2, 1.3, 6.2, 0.9,...}
How can I select the sum of that column?
Something along the lines of:
SELECT id, sum(monthly_usage) as total_usage from users;
Which obviously doesn't work.