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 |
|
dev45
Yak Posting Veteran
54 Posts |
Posted - 2004-09-29 : 08:54:32
|
| hi,i have run into the following piece of codeSELECT colA,colB,colC FROMTable1INNER JOIN Table2 on Table2.codD = @parameter1 AND Table1.colE = @parameter2it seems to be working fine but is it correct ? i understand that there should be a WHERE clause (WHERE table2.cold = @parameter1 AND ...), but since there are a lot of queries to change (and test to be redone) do u think it is safe to leave as they are? |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2004-09-29 : 08:59:05
|
| an inner join such as above is equivalent to the below.SELECT colA,colB,colCFROMTable1, Table2WHERE Table2.codD = @parameter1 AND Table1.colE = @parameter2Other types of JOIN's (LEFT,CROSS,etc) however do not quite have this property. |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2004-09-29 : 09:07:32
|
| the only difference is if it were a LEFT outer join -- then the meaning of the criteria in the join expression versus the WHERE is very different.- Jeff |
 |
|
|
|
|
|