| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Is inner query executed for each row of ... ?
hello
When we execute SELECT statement, the following steps are taken:
1) temporary table ( call it T ) is created
2) the number of rows T has equals to all possible combinations with
which the rows from the two tables can be joined ( assuming there are
more than one tables specified inside the FROM clause )
3) rows that return FALSE ( when checked against conditions in the
WHERE clause ) are deleted
4) Attributes that will not appear in the resulting table are deleted
When we execute the following SELECT statement ( outer query ), a temporary table T with 20 rows is created:
SELECT a1, a2
FROM A
WHERE ( SELECT COUNT(*)
FROM B
WHERE B.b1 = A.a1
) >= 2
thank you Received on Tue Jul 31 2007 - 06:07:59 CDT
![]() |
![]() |