SELECT
processing order For the query from the reading:
SELECT i1.CustABN
FROM INVOICE i1, INVOICE i2
WHERE i1.CustABN = i2.CustABN
AND TRUNC(i1.InvDate) = DATE '2004-9-16'
AND TRUNC(i2.InvDate) = DATE '2004-10-6';
Using the six step process work out the query output after each step.
FROM
This creates the cross product for the two instances of the table INVOICE. Every row in the INVOICE table is combined with every other row.
The first lines of the output are:
Notice that the two dates needed for the query, now appear on the same row.
WHERE
All the rows that do not satisfy the where condition i.e.
WHERE i1.CustABN = i2.CustABN
are eliminated.
AND TRUNC(i1.InvDate) = DATE '2004-9-16'
AND TRUNC(i2.InvDate) = DATE '2004-10-6';
The first lines of the output are:
The spurious rows from Step One are deleted.
GROUP BY & HAVING
These steps are not applicable
SELECT
The output columns are now chosen:
SELECT i1.CustABN
The output becomes:
ORDERBY
This steps is not applicable