If I have the following table:
Table \"users\" Column | Type | Modifiers ---------------+------------------+----------- id | i
This generalization and reformatting Dmitry's answer helps me understand how it works:
SELECT sum(a) AS total FROM ( SELECT unnest(array [1,2,3]) AS a ) AS b
Result:
total 6