I can produce the same result with the where clause inside the join or the where clause outside the join, like:
select *
from a
join b on b.id = a.id and b.type = 1
or
select *
from a
join b on b.id = a.id
where
b.type = 1
Whats better? Why?
ps: feel free to edit my title, i dont know how to proper name the question.
Using the father
Sybase ASE 15.0and with no statistics on both tables:First query
Second query
Both queries have the same execution plan so they will take the same time 🙂