Search notes:

ORA-00904: invalid identifier

ORA-00940: invalid identifier typically indicates that the SQL parser recognized a token as an identifier but the identifier referred to nothing.
For exampile, dual has no column named no_such_column, therefore, the following SQL statement throws this error:
select
   dummy,
   no_such_column
from
   dual;
This error is often seen when a user thinks a function exists which in reality does not. For example, a developer coming from SQL Server might think Oracle has a function named isNull and hit such an error:
select
   isnull(dummy, 'Y') dummy_
   from
     dual;
The error message ORA-00904: invalid identifier might also be caused in a create table statement if a column name was expected but none was given:
create table tq84_invalid_identifier (
   id    number(9)    primary key,
   val   varchar2(10)            ,  -- <== Note the comma
);

UNION ALL in combination with ORDER BY

Interestingly, an ORA-00904 is also thrown in the following statement (even though dual has a column named dummy):
select * from dual union all
select * from dual
order by dummy;
If the order by clause is applied to the first query, Oracle throws ORA-00933: SQL command not preperly ended.

See also

ORA-00936: missing expression, ORA-00942: table or view does not exist.
Surprisingly (at least to me), an ORA-00904 error is also thrown if the second parameter of the standard_hash function is passed a value with lowercase letters.
Other Oracle error messages

Index