Clement Okereke
Clement Okereke

Reputation: 1

How do I solve a FROM keyword error in Oracle SQL?

I tried doing the query for the assingment:

select invoice_number, vendor_id,
       payment_total - invoice_total AS 'Reamaining Total' 
from invoices;

But I keep getting this error: ORA-00923: FROM keyword not found where expected:

  1. 00000 - "FROM keyword not found where expected" *Cause:
    *Action: Error at Line: 14 Column: 68

Upvotes: 0

Views: 52

Answers (2)

Tim Biegeleisen
Tim Biegeleisen

Reputation: 521339

Use double, not single, quotes to escape identifiers in Oracle SQL:

SELECT invoice_number, vendor_id,
       payment_total - invoice_total AS "Remaining Total"
FROM invoices;

Upvotes: 1

Gordon Linoff
Gordon Linoff

Reputation: 1269873

Single quotes should be used only for string and date constants. Try writing the query without escaping any identifiers:

select invoice_number, vendor_id,
       (payment_total - invoice_total) AS remaining_total
from invoices;

Upvotes: 0

Related Questions