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
group by site_id
order by ordcnt desc
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.
Pablo (Paul) Berzukov
Author of Understanding Database Administration
available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Click Here to Expand Forum to Full Width