Squence of Joining & Filtering
TABLE1 TABLE2
COLUMN1 COLUMN1
1 1
2 3
After running
select *
from TABLE1 a left join TABLE2 b
on a.COLUMN1=b.COLUMN1
where b.COLUMN1 is NULL;,
the results are
2 NULL
Hence, database servers are deduced to join tables 1st. Then it filters the records according to the condition. If the sequence was reversed, the results would be following.
1 NULL
2 NULL
select *
from (
select *
from TABLE3
where COLUMN2='Test1'
) a
inner join
select *
from (
select *
from TABLE4
where COLUMN3='Test2'
) b
on a. COLUMN1=b.COLUMN1;