SQL Query: Accumulate a column
SQL Query: Accumulate a column
(OP)
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
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





RE: SQL Query: Accumulate a column
i think the answer is
select invno,artno,sum(quan),text
from table_name
group by invno,artno,text