Hi
Could someone suggest a query which will achieve the following:
I bcp a flat file into an import table. The flat file has multiple records for each product eg
SKU QTY
1234 1
1234 3
4321 1
1234 2
I need a query which will accrue the qtys for each sku and write the total per sku to another table ie
SKU QTY
1234 6
4321 1
The existing contents of the tables are discarded each time the file is imported so thats not a problem.
I'm quite new to SQL. Do I need a nested query or a correlated query or something else entirely to achieve this?
Thanks in advance...
Could someone suggest a query which will achieve the following:
I bcp a flat file into an import table. The flat file has multiple records for each product eg
SKU QTY
1234 1
1234 3
4321 1
1234 2
I need a query which will accrue the qtys for each sku and write the total per sku to another table ie
SKU QTY
1234 6
4321 1
The existing contents of the tables are discarded each time the file is imported so thats not a problem.
I'm quite new to SQL. Do I need a nested query or a correlated query or something else entirely to achieve this?
Thanks in advance...