A correlated sub-query is a subquery that references the value/s from the main query. example : SELECT colA , colB FROM tableA WHERE colB < ( SELECT max(colX) FROM tableB WHERE tableB.colY = tableA.colA) Oracle executes correlated subquery for each record from of main query .. hence these types of queries have greater impact on performance and must be avoided
Above answer was rated as good by the following members: premramana
A correlated sub-query is a subquery that references the value/s from the main query. example : SELECT colA colB FROM tableA WHERE colB < ( SELECT max(colX) FROM tableB WHERE tableB.colY tableA.colA) Oracle executes correlated subquery for each record from of main query .. hence these types of queries have greater impact on performance and must be avoided
when a sub query executes for each row its called a corelated sub query in other words when a sub query takes the input from outer query for executation then execute and passes the result to outer query then outer query executes.