calculating percentage in postgresql code example
Example: running percentage of total postgres
SELECT
*, (value / SUM(value) OVER ()) AS "% of total"
FROM
transactions
WHERE
quarter = '2015-03-31' and company_id = 1;
SELECT
*, (value / SUM(value) OVER ()) AS "% of total"
FROM
transactions
WHERE
quarter = '2015-03-31' and company_id = 1;