Running Total BAQ

Here’s one example.

They are called windowing functions.
You can do a sum over partition with an order by and it will give you a running total. No need for a sub query or group by. There are More examples here of you keep searching.