Hot answers tagged


The query is syntactically correct SQL even if table_b does not have a name column. The reason is scope resolution. When the query is parsed, it is first checked whether table_b has a name column. Since it doesn't, then table_a is checked. It would throw an error only if neither of the tables had a name column. Finally the query is executed as: select a....


Because Oracle performs a correlated subquery when a nested subquery references a column from a table referred to a parent statement one level above the subquery. It means in order to determine whether subquery is correlated Oracle must try to resolve names in ...


There is no name field in table_b so Oracle takes the one from table_a. I tried the EXPLAIN PLAN but this gave me only that there is a TABLE ACCESS FULL. I presume that this will generate some kind of Cartesian Product between both tables that result in a list of all the names in table_a is returned by the sub-query.

Only top voted, non community-wiki answers of a minimum length are eligible