Resolve ORA-00923 Error Message in Oracle

Learn the cause and how to resolve the ORA-00923 error message in Oracle.

Description

When you stumble upon an ORA-00923 error, the following error message will appear:

ORA-00923: FROM keyword not found where expected

Cause

You tried to execute a SELECT statement, and you both missed or misplaced the FROM keyword.

Resolution

The option(s) to resolve this Oracle error are:

Option #1

This error can appear when executing a SELECT assertion that is lacking the FROM keyword.

For example, if you tried to execute the following SELECT statement:

SELECT *
suppliers;

You should correct this SELECT assertion by means of along with the FROM key-word as follows:

SELECT *
FROM suppliers;

Option #2

This error can additionally take place if you use an alias, however do not consist of the alias in double quotation marks.

For example, if you tried to execute the following SQL statement:

SELECT owner AS 'owner column'
FROM all_tables;

You could right this SELECT announcement by using using double citation marks around the alias:

SELECT owner AS "owner column"
FROM all_tables;

Option #3

This error can also happen if you add a calculated column to a SELECT * statement.

For example, if you tried to execute the following SQL statement:

SELECT *, CAST((FROM_TZ(CAST(last_modified_date AS timestamp),'+00:00') at time zone 'US/Pacific') AS date) AS "Local Time"
FROM suppliers;

You ought to correct this SELECT declaration by way of which include the table title qualifier in front of the wildcard:

SELECT suppliers.*, CAST((FROM_TZ(CAST(last_modified_date AS timestamp),'+00:00') at time zone 'US/Pacific') AS date) AS "Local Time"
FROM suppliers;

Option #4

You can also generate this error by way of having an unbalanced set of parenthesis.

For example, if you tried to execute the following SQL statement:

SELECT COUNT(*)) AS "Total"
FROM suppliers;

You may want to correct this SELECT assertion by means of disposing of the more closing parenthesis just prior to the alias:

SELECT COUNT(*) AS "Total"
FROM suppliers;