I am getting different result set for these two queries and second result set seems to be correct. What is the difference in these queries.
What type of inner join q
Looking at the edit history of the question it appears that your queries are along the following lines.
Query One
INNER JOIN dbo.T2
ON ...
LEFT OUTER JOIN dbo.T3
ON ...
WHERE
T3.col = somevalue AND ...
Query Two
INNER JOIN dbo.T2
ON ...
LEFT OUTER JOIN dbo.T3
ON ... AND T3.col = somevalue
WHERE
...
The difference between them is that Query One effectively converts the LEFT
Join to an INNER
Join.
For a left outer join conceptually the following happens.
None of these rows added back in in step 2 will meet the T3.col = somevalue
predicate in step 3 as we know that the value of this column for all these rows is NULL
.