Hi,
I have a table that contains up to 3 columns that may or may not contain price data for up to 3 SKU's
Each record will have at least a value for SKU1 but may also have a value for SKU2 and possibly a value for SKU3.
I am trying to write a query that will give me a count of how many times each SKU has been used and the total amount charged for each SKU. So the results for the query would look like:
Any help would be appreciated.
I have a table that contains up to 3 columns that may or may not contain price data for up to 3 SKU's
Code:
ID SKU1 PRICE1 SKU2 PRICE2 SKU3 PRICE3
--------------------------------------------------
001 AAAA 10.00 BBBB 12.00 CCCC 15.00
002 BBBB 12.50
003 DDDD 20.00 AAAA 8.00
Each record will have at least a value for SKU1 but may also have a value for SKU2 and possibly a value for SKU3.
I am trying to write a query that will give me a count of how many times each SKU has been used and the total amount charged for each SKU. So the results for the query would look like:
Code:
SKU CNT TOTAL
-----------------
AAAA 2 18.00
BBBB 2 22.50
CCCC 1 15.00
DDDD 1 20.00
Any help would be appreciated.