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 |
|
lane0618
Posting Yak Master
134 Posts |
Posted - 2002-05-08 : 14:34:31
|
| I have to colummns, item and qty in a SQL 2000 table: item qty123-001 20123-001 7321-006 5321-006 15I want to make a view that return a distinct record and the sum of the qty for all equal items like this: item qty123-001 27321-006 20How can I do this?Thanks in Advance!Lane |
|
|
M.E.
Aged Yak Warrior
539 Posts |
Posted - 2002-05-08 : 15:03:57
|
| I'm not quite sure of exact syntax... but I do believe it'sSelect item, sum(qty) as 'total sum)from tablegroup by itemGroup by is the key term there (might be groupby.. not quite sure, not on a computer with sql currently) |
 |
|
|
lane0618
Posting Yak Master
134 Posts |
Posted - 2002-05-08 : 17:39:14
|
| That does the trick.Thanks!! |
 |
|
|
|
|
|