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 cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Query: Accumulate a column

Status
Not open for further replies.

jacom

Computer
Joined
Mar 27, 2001
Messages
2
Location
DE
Hallo, could somebody help me in this SQL-Problem?

My table contains the following columns:
Invoicenumber / Articlenumber / Quantity / Text

Records should be added in the column Quantity, when the Invoicenumbers are identical and Articlenumber are identical.

Example:
INVNO / ARTNO / QUAN / TEXT
4711 / 312 / 3 / Table
4711 / 434 / 6 / Chair
4711 / 312 / 2 / Table
4712 / 312 / 7 / Table

The result should be:
4711 / 312 / 5 / Table
4711 / 434 / 6 / Chair
4712 / 312 / 7 / Table

Thanks for help
Didi
 
accouding to your example,
i think the answer is


select invno,artno,sum(quan),text
from table_name
group by invno,artno,text
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top