Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need help with this function. I need it in SQL not Oracle. I am using Microsof

ID: 3834753 • Letter: I

Question

I need help with this function. I need it in SQL not Oracle. I am using Microsoft SQL Server 2012

9. Write a function that calculates the total price of the items sold per each invoice/order. Use LINE table to make the calculation [10] LINE NV NUMBER LINE NUMBER PROD CODE LINE UNITS LINE PRICE LINE AMOUNT 1001 4243213 1200247 69.99 69.99 1001 1003 4243213 85 85 1003 0637032 1003 1200247 69.99 69.99 PRODUCT PROD CODE PROD DESCRIPT PROD NDATE PROD QOH PROD MIN PROD PRICE PROD DISCOUNT VEND NUMBER 4243213 2015-11-03 00:00:00.000 8 Snow Suit 21225 21344 0637032 Mens Training Shoes 2015-12-13 00:00:00.000 32 15 0.05 Womens Basketbal... 2015-02-24 00:00:00.000 237 69.99 1200247 100 21344

Explanation / Answer

The sql is below:-

select INV_NUMBER,sum(LINE_AMOUNT) as Total_Price from LINE group by INV_NUMBER;

Group by function will aggregate the total sum for each invoice number separately.