Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
heathergilster
Starting Member
1 Post |
Posted - 2007-04-02 : 15:03:24
|
Ok, here's what I have:Table 1DAY Price QTYTuesday $50 3Tuesday $50 5Wednesday $80 2Wednesday $80 2Thursday $20 2Thursday $20 2What I need to do is sum the Price and QTY columns based on the DAY column. Essentially where it's Tuesday it would say:Tuesday $100 8Please help! |
|
NeilG
Aged Yak Warrior
530 Posts |
Posted - 2007-04-02 : 15:19:04
|
I would use something along the lines of the following select [Day] , sum(price)as [Total price], Sum(qty) as [Total Qty]from table group by [Day] |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|