Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

running-totals in sql statement

Status
Not open for further replies.

jonnyk

Programmer
Jan 11, 2001
19
0
0
GB
I need to add a column to a sql statement that will give me a running total by group

sql is
selct item, week, sum(qty)
group by item, week

The column will need to add qty as a running total for each item for each week

Any ideas
 
Look at using the with rollup clause in your select.

Questions about posting. See faq183-874
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top