I asked this question earlier, and did not get the right output. I have some cod
ID: 3836162 • Letter: I
Question
I asked this question earlier, and did not get the right output. I have some code but it does not work. I was wondering if anyone can help me with this. Need it in SQL, not ORACLE. Do not worry about question 2
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 INV NUMBER LINE NUMBER PROD CODE LINE UNITS LINE PRICE LINE AMOUNT 39 39 1001 4243213 1001 69.99 1200247 69.99 4243213 1003 39 1003 0637032 1003 69.99 1200247 69.99Explanation / Answer
Below SQL statement can solve this
Select inv_number,sum(line_amount) AS Total_Price FROM Line GROUP BY inv_number;
here we group the table by invoice number and calculate sum of rows and display them accordingly.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.