Learn the reason and how to get to the bottom of the ORA-00928 error message in Oracle.
Description
When you stumble upon an ORA-00928 error, the following error message will appear:
ORA-00928: missing SELECT keyword
Cause
You tried to create an Oracle VIEW, but neglected the SELECT keyword.
Resolution
The option(s) to resolve this Oracle error are:
Option #1
Correct the CREATE VIEW declaration and re-execute it.
For example, if you had tried to create a view as follows:
CREATE VIEW sup_orders AS
suppliers.supplier_id, orders.quantity, orders.price
FROM suppliers
INNER JOIN orders
ON suppliers.supplier_id = orders.supplier_id
WHERE suppliers.supplier_name = 'IBM';
You would receive the following error message:
You could correct the CREATE VIEW announcement by along with the SELECT key-word as follows:
CREATE VIEW sup_orders AS
SELECT suppliers.supplier_id, orders.quantity, orders.price
FROM suppliers
INNER JOIN orders
ON suppliers.supplier_id = orders.supplier_id
WHERE suppliers.supplier_name = 'IBM';
Leave a Review