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 |
|
Zevher
Starting Member
3 Posts |
Posted - 2009-11-22 : 23:25:22
|
| i have 4 field orderID,SO,StockID,QtyLike thisOrderID SO StockID Qtyx-0 z-2 tes 5x-0 z-2 yos 4 x-0 z-2 pro 4x-0 s-2 no 4I want to sum all that qty fieldand get the answer is 17how is the sql code? please help me |
|
|
Zevher
Starting Member
3 Posts |
Posted - 2009-11-23 : 01:06:48
|
| Worst Forum Ever. |
 |
|
|
vikky
Yak Posting Veteran
54 Posts |
Posted - 2009-11-23 : 01:28:09
|
| HI,select order_id,sum(qty) from ur table.Thanks,vikky. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-11-23 : 04:05:49
|
quote: Originally posted by Zevher Worst Forum Ever.
Why? you want to get answers in a minute MadhivananFailing to plan is Planning to fail |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-11-23 : 04:07:55
|
quote: Originally posted by vikky HI,select order_id,sum(qty) from ur table.Thanks,vikky.
1 select order_id,sum(qty) from ur table group by order_id2 select sum(qty) from ur table.MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|