Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

running percentage of total postgres

SELECT
  *,  (value / SUM(value) OVER ()) AS "% of total"
FROM
  transactions
WHERE
  quarter = '2015-03-31' and company_id = 1;
Source by snippets.aktagon.com #
 
PREVIOUS NEXT
Tagged: #running #percentage #total #postgres
ADD COMMENT
Topic
Name
3+8 =