select *, sum(sale)over(order by yyyy rows between unbounded preceding and current row) from( select sum(sales) as sale,extract(year from order_date)yyyy from orders_table as ot group by 2 order by 2 asc )t1;
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter