I have a Order Details table.
What I want to do is create 1 query to show
OrderNumber | SKU | QTY | Price | Line Total |
1 SKU1 1 10.00 10.00
1 ---- 0 0.00 10.00
2 SKU1 2 10.00 20.00
2 SKU2 3 1.50 4.50
2 ---- 0 0.00 24.50
I mean I need to add another line for each
order with total amount for export to text file.
I have SQL Server 2005
Thank you.
The extra column is easy, just create another output column in the sql that is defined as the product of the two exsting attributes
The second part, adding a subtotal row, can be done with a keyword
Rollupor by unioning with an aggregate query