Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
bigeldm
Starting Member
2 Posts |
Posted - 2013-01-31 : 17:39:31
|
I can't figure out when to put the selection criteria as part of the join and when it should be part of the where clause.for example - what is the difference betweenSelect table1.field1, table2.field2, table3.field3from table1Left Join table2on table1.field1 = table2.field1 and table2.field2 <> 'abc'Left Join table3on table1.field1 = table3.field1AND Select table1.field1, table2.field2, table3.field3from table1Left Join table2on table1.field1 = table2.field1Left Join table3on table1.field1 = table3.field1WHERE table2.field2 <> 'abc' or table2.field1 is nullHow does one know when to use one over the other?? I get different results depending on where I put the selection criteria and don't understand why. |
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
bigeldm
Starting Member
2 Posts |
Posted - 2013-02-01 : 08:17:29
|
Thank you so much - this completely answered my question. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-02-01 : 12:22:51
|
welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|