-
Running total query
Thanks in advance for your suggestion and help. When I execute the query below
select site_id,count (order_id) as ORDCNT
from itc_com_order_header
where platform_id='GT'
group by site_id
order by ordcnt desc
RESULT/output
SITE_ID ORDCNT
470 1239
662 491
581 150
What I want/expected output
SITE_ID ORDCNT Running Total
470 1239 1239
662 491 1730
581 150 1880
How do i do that in ORACLE?
-
Either write the output of your first query into a temp table or wrap it up as an inline view; then use sum() analytical function to display running total.