For every invoice, display the invoice number, invoice date and the total dollar amount for all products purchased in the invoice, ordered by invoice number in descending order and then by invoice date in ascending order. Here you will use an aggregate SUM(x,y) function in your SELECT clause to calculate the total dollar amount (a calculated field – name it TOTAL). Don’t forget to join on the tables as well. [hint: you should have 8 rows of output ordered properly]. My code is as follows: select inv_number, inv_date, sum(line_price) as 'total' from invoice, line where invoice.inv_number = line.inv_number order by inv_number desc, inv_date asc ;  I am getting this error: ORA-00923: FROM keyword not found where expected Any recommendations on what I am doing wrong?

Principles of Information Systems (MindTap Course List)
12th Edition
ISBN:9781285867168
Author:Ralph Stair, George Reynolds
Publisher:Ralph Stair, George Reynolds
Chapter10: Information And Decision Support Systems
Section: Chapter Questions
Problem 1DQ3
icon
Related questions
icon
Concept explainers
Question

SQL:

For every invoice, display the invoice number, invoice date and the total dollar amount for all products purchased in the invoice, ordered by invoice number in descending order and then by invoice date in ascending order. Here you will use an aggregate SUM(x,y) function in your SELECT clause to calculate the total dollar amount (a calculated field – name it TOTAL). Don’t forget to join on the tables as well. [hint: you should have 8 rows of output ordered properly].

My code is as follows:

select inv_number, inv_date, sum(line_price) as 'total' from invoice, line where invoice.inv_number = line.inv_number order by inv_number desc, inv_date asc ; 

I am getting this error:

ORA-00923: FROM keyword not found where expected

Any recommendations on what I am doing wrong?

 

CUSTOMER
aus CODE
CUS LNAME
CUS FNAME
CUS INITIAL
CUS AREACODE
CUS PHONE
CUS BALANCE
PRODUCT
PODE.
DESCRI PT
INDATE
PCOH
P MIN
P PRICE
P DISOOUNT
V_CODE
VENDOR
V CODE
V NAME
V CONTACT
V_AREACODE
V PHONE
V STATE
V ORDER
INVOICE
INV NUMBER
CUS CODE
INV DATE
UNE
INV NIMBER
TINE NUMBER
P OODE
INE UNITS
LINE PRICE
EMPLOYEE
00
EMP NUM
BMP TITLE
EMP LNAME
BMP ANAME
BMP_INITIAL
EMP DOB
BMP HI RE DATE
BMP AREACODE
EMP PHONE
1 BMP_MGR
G瓦图
164%
Transcribed Image Text:CUSTOMER aus CODE CUS LNAME CUS FNAME CUS INITIAL CUS AREACODE CUS PHONE CUS BALANCE PRODUCT PODE. DESCRI PT INDATE PCOH P MIN P PRICE P DISOOUNT V_CODE VENDOR V CODE V NAME V CONTACT V_AREACODE V PHONE V STATE V ORDER INVOICE INV NUMBER CUS CODE INV DATE UNE INV NIMBER TINE NUMBER P OODE INE UNITS LINE PRICE EMPLOYEE 00 EMP NUM BMP TITLE EMP LNAME BMP ANAME BMP_INITIAL EMP DOB BMP HI RE DATE BMP AREACODE EMP PHONE 1 BMP_MGR G瓦图 164%
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Query Syntax
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781285867168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning