Subselect with Inner Join on Oracle 11g

Asked

Viewed 49 times

0

In Oracle 11g version, when we try to select with a subselect that connects the internal table with the external one by Inner Join, the error occurs "ORA-00904: "FIELD": invalid identifier".

select count(*) from user_tables A where exists (select 0 from user_indexes B inner join user_ind_columns C on (B.table_name = A.table_name));

I know that from the 12c version this error does not occur anymore, because I have access to installations in both versions.

Is there any patch fix for this error in 11g version, or it is fixed just by upgrading to 12c?

  • 1

    It makes no sense for you to place a reference to the external table in the join condition of your subselect. The joining condition should refer to tables B and C. Perhaps the reference to table A should be in a WHERE clause?

  • Honestly, I don’t know if in any situation it makes sense to do so, this command I posted is just an example to illustrate the error. The fact is that in 12c this command runs, and I do not know if in any version of SQL Server after the implementation of Inner Join an error like this occurred. But my doubt has nothing to do with the syntax of the command, but whether Oracle has released an update to 11g that fixes this, or whether it is only from 12c that is fixed even.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.