Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

ORA-00923: FROM keyword not found where expected

sirbolbiFeb 14 2021

Hello, I am trying to get this to work right, but it keeps saying that my FROM isn't stated correctly.
What do I have wrong?
SELECT RESERVATION_ID, TRIP_ID, CUSTOMER_NUM, ('TRIP_PRICE' + 'OTHER FEES') * NUM_PERSON AS 'TOTAL_PRICE'
FROM RESERVATION, TRIP, CUSTOMER
WHERE NUM_PERSONS > 4
AND 'RESERVATION_ID' = 'TRIP_ID'
AND CUSTOMER 'CUSTOMER_NUM' = RESERVATION 'CUSTOM_NUM';

Comments

Solomon Yakobson

get rid of quotes.
qualified name syntax is dot separated
Something (we have to knowledge of your tables):

SELECT  RESERVATION_ID,
        TRIP_ID,
        CUSTOMER_NUM,
        (TRIP_PRICE + OTHER FEES) * NUM_PERSON AS TOTAL_PRICE
  FROM  RESERVATION,
        TRIP,
        CUSTOMER
  WHERE NUM_PERSONS > 4
    AND RESERVATION_ID = TRIP_ID
    AND CUSTOMER.CUSTOMER_NUM = RESERVATION.CUSTOM_NUM;

SY.

sirbolbi

When trying this way around, I get the error, ORA-00907: missing right parenthesis.

EdStevens

Shouldn't OTHER FEES be OTHER_FEES?

Solomon Yakobson

Ah, I missed that.
SY.

1 - 4

Post Details

Added on Feb 14 2021
4 comments
1,012 views