Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

What is the choice of predicate in the ON or WHERE caluse?

$
0
0

Hello,

Can anyone tell me what is the choice of the side (left/right)  of predicate in ON or WHERE clause?

Suppose there is a select statement

select * from table1 t1

inner join table2 t2 on t1.column1=t2.column1

left join table3 t3 on t3.column1=t2.column1

On what scenarios should we change the left/right side predicate order.

i.e when should we put the order of predicate the other way

1) t2.column1=t1.column1 

2) t2.column1=t3.column1

Does it affect performance of a query in any way?

Regards


Regards


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>