Tom Cooper
3/30/2007 1:58:00 PM
Those two queries will always return the same result set. Note, however,
that if instead you compare columns from the table on the right side of the
left outer join, it makes a difference. That is, the following two queries
ARE different (the second one is effectively an inner join).
Select *
from mytable a left join anothertable b on a.col = b.col and b.somedate =
@somedate
vs.
Select *
from mytable a left join anothertable b on a.col = b.col
Where b.somedate = @somedate
Tom
"Raterus" <raterus@hotmail.com> wrote in message
news:e9c8OJtcHHA.4720@TK2MSFTNGP04.phx.gbl...
Will there EVER be a difference in results returned between using a variable
in the join vs. using it in the where clause?
Select *
from mytable a left join anothertable b on a.col = b.col and a.somedate =
@somedate
vs.
Select *
from mytable a left join anothertable b on a.col = b.col
Where a.somedate = @somedate