Im trying to run the following SQL in Oracle: SELECT GUEST_KR.FIRSTNAME, GUEST_KR.LASTNAME,FEE_KR.DateCharged,FEE_KR.FeeDescription,FEE_KR.FeeCharged,SUM(FeeCharged) AS TotalFeeCharged FROM FEE_KR JOIN SERVICE_KR ON FEE_KR.ServiceID = SERVICE_KR.ServiceID JOIN GUEST_KR ON SERVICE_KR.ServiceID = GUEST_KR.GuestID WHERE ServiceName IN ('First Name', 'Last Name', 'Date Charged', 'Fee Description') WHERE ServiceName NOT IN (SELECT FEETYPE FROM REPORT_FILTER_KR) GROUP BY GUEST_KR.FIRSTNAME, GUEST_KR.LASTNAME,FEE_KR.DateCharged,FEE_KR.FeeDescription,FEE_KR.FeeCharged ORDER BY SUM(FeeCharged) DESC; And I'm recieving this error:   Error starting at line : 1 in command - SELECT GUEST_KR.FIRSTNAME, GUEST_KR.LASTNAME,FEE_KR.DateCharged,FEE_KR.FeeDescription,FEE_KR.FeeCharged,SUM(FeeCharged) AS TotalFeeCharged FROM FEE_KR JOIN SERVICE_KR ON FEE_KR.ServiceID = SERVICE_KR.ServiceID JOIN GUEST_KR ON SERVICE_KR.ServiceID = GUEST_KR.GuestID WHERE ServiceName IN ('First Name', 'Last Name', 'Date Charged', 'Fee Description') WHERE ServiceName NOT IN (SELECT FEETYPE FROM REPORT_FILTER_KR) GROUP BY GUEST_KR.FIRSTNAME, GUEST_KR.LASTNAME,FEE_KR.DateCharged,FEE_KR.FeeDescription,FEE_KR.FeeCharged ORDER BY SUM(FeeCharged) DESC Error at Command Line : 6 Column : 1 Error report - SQL Error: ORA-00933: SQL command not properly ended 00933. 00000 -  "SQL command not properly ended" *Cause:     *Action: How do I fix this?

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter12: Subqueries And Merge Statements
Section: Chapter Questions
Problem 19MC
icon
Related questions
Question
100%

Im trying to run the following SQL in Oracle:

SELECT GUEST_KR.FIRSTNAME, GUEST_KR.LASTNAME,FEE_KR.DateCharged,FEE_KR.FeeDescription,FEE_KR.FeeCharged,SUM(FeeCharged) AS TotalFeeCharged
FROM FEE_KR
JOIN SERVICE_KR ON FEE_KR.ServiceID = SERVICE_KR.ServiceID
JOIN GUEST_KR ON SERVICE_KR.ServiceID = GUEST_KR.GuestID
WHERE ServiceName IN ('First Name', 'Last Name', 'Date Charged', 'Fee Description')
WHERE ServiceName NOT IN (SELECT FEETYPE FROM REPORT_FILTER_KR)
GROUP BY GUEST_KR.FIRSTNAME, GUEST_KR.LASTNAME,FEE_KR.DateCharged,FEE_KR.FeeDescription,FEE_KR.FeeCharged
ORDER BY SUM(FeeCharged) DESC;

And I'm recieving this error:

 

Error starting at line : 1 in command -
SELECT GUEST_KR.FIRSTNAME, GUEST_KR.LASTNAME,FEE_KR.DateCharged,FEE_KR.FeeDescription,FEE_KR.FeeCharged,SUM(FeeCharged) AS TotalFeeCharged
FROM FEE_KR
JOIN SERVICE_KR ON FEE_KR.ServiceID = SERVICE_KR.ServiceID
JOIN GUEST_KR ON SERVICE_KR.ServiceID = GUEST_KR.GuestID
WHERE ServiceName IN ('First Name', 'Last Name', 'Date Charged', 'Fee Description')
WHERE ServiceName NOT IN (SELECT FEETYPE FROM REPORT_FILTER_KR)
GROUP BY GUEST_KR.FIRSTNAME, GUEST_KR.LASTNAME,FEE_KR.DateCharged,FEE_KR.FeeDescription,FEE_KR.FeeCharged
ORDER BY SUM(FeeCharged) DESC
Error at Command Line : 6 Column : 1
Error report -
SQL Error: ORA-00933: SQL command not properly ended
00933. 00000 -  "SQL command not properly ended"
*Cause:    
*Action:

How do I fix this?

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Intermediate SQL concepts
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
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr