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
The difference under the hood is that the WHERE clause is accessed after all the joins.
This means that maybe in this case there is no difference but that would not always be true when there are multiple joins. They could be factored out of the virtual resultsets (depending on the circumstances) before the WHERE is processed.
Kindly see this link: http://blog.sqlauthority.com/2009/04/06/sql-server-logical-query-processing-phases-order-of-statement-execution/