Error (ORA-00923: FROM keyword not found where expected)

Add comma after SELECT QUERY


In my case, I had this query

SELECT BANK_NAME
DECODE (SWIFT_CODE, 'BRDEROBU', 'BRD',
                   'NO RESULT') RESULT
FROM BANK_GAR;

As you may see, I didn't had the comma after the SELECT BANK_NAME line.

The correct query is:

SELECT BANK_NAME,
DECODE (SWIFT_CODE, 'BRDEROBU', 'BRD',
                   'NO RESULT') RESULT
FROM BANK_GAR;

Identifiers need to be quoted with double quotes ("). Single quotes (') denote a character value (not a "name").

Therefor you need to use:

SUM(part_gold) as "Number of Gold Medals"

More details in the manual:

  • Database Object Names and Qualifiers
  • Text literals

Check reserved words. This was my issue. For whatever reason using "size" as a column alias caused oracle to spit that exact error out and it had me scratching my head for a while.

select 1 size, 1 id from dual

Tags:

Sql

Oracle