Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • 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
Mar 27, 2001
2
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
 
Replies continue below

Recommended for you

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