- Aug 7, 2006
- 570
- 0
- 0
For simplicity, let's say that my current table has three fields:
Part# (not unique)
NumInStock
SupplierName
Basically, I want to do a select statement the sums up the total number of items in stock across all suppliers. So basically lets say that two of the rows are:
Part # | NumInStock | SupplierName
-------------------------------------------------
ABC | 3 | Supplier1
ABC | 5 | Supplier2
What I want returned from my select statement is:
Part # | NumInStock
----------------------------
ABC | 8
I'm sure this is pretty common, but it's been a while since I've had to do all that much SQL and figure this is the kind of thing that would be better done by the DB than the application.
Part# (not unique)
NumInStock
SupplierName
Basically, I want to do a select statement the sums up the total number of items in stock across all suppliers. So basically lets say that two of the rows are:
Part # | NumInStock | SupplierName
-------------------------------------------------
ABC | 3 | Supplier1
ABC | 5 | Supplier2
What I want returned from my select statement is:
Part # | NumInStock
----------------------------
ABC | 8
I'm sure this is pretty common, but it's been a while since I've had to do all that much SQL and figure this is the kind of thing that would be better done by the DB than the application.
