See if I have this right.
You want "volume" to be a running total of two values. Yes?
If so, it cannot be done in a single SQL query. SQL simply doesn't work like that.
At first looks I would say that you will need to write a stored procedure to perform a query that returned the required records, THEN have a routine to iterate through the returned rows and insert the running total into each row.
Certainly NOT something for an inexperienced DBA to be trying to accomplish
Your running total would be done simpler (and possibly quicker) when you are processing and displaying the returned records.
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
|