Are you executing this query as part of an INSERT or DELETE?
If so, remove the ORDER BY. It's not needed anyway.
Error: ORA-00933: SQL command not
properly ended
Cause: You tried to
execute an SQL statement with an
inappropriate clause.
Action: The
options to resolve this Oracle error
are:
You may have executed an INSERT
statement with an ORDER BY Clause. To
resolve this, remove the ORDER BY
clause and re-execute the INSERT
statement. For example, you tried to
execute the following INSERT
statement:
INSERT INTO supplier (supplier_id,
supplier_name) VALUES (24553, 'IBM')
ORDER BY supplier_id;
You can correct the INSERT statement
by removing the ORDER BY clause as
follows:
INSERT INTO supplier (supplier_id,
supplier_name) VALUES (24553, 'IBM');
You may have tried to execute a DELETE
statement with an ORDER BY Clause. To
resolve this, remove the ORDER BY
clause and re-execute the DELETE
statement. For example, you tried to
execute the following DELETE
statement:
DELETE FROM supplier WHERE
supplier_name = 'IBM' ORDER BY
supplier_id;
You can correct the DELETE statement
by removing the ORDER BY clause as
follows:
DELETE FROM supplier WHERE
supplier_name = 'IBM';