| 
	
 | 
 Posted by Hugo Kornelis on 02/15/06 00:29 
On 14 Feb 2006 14:09:09 -0800, mariohiga wrote: 
 
>Hello 
>I've a really big doubt :)  I've this two alternatives 
> 
>SELECT * 
>  FROM T1 a 
>  INNER JOIN T1 b 
>  ON a.F1 = b.F1 
>  AND a.F2 = 1 
> 
>SELECT * 
>  FROM T1 a 
>  INNER JOIN T1 b 
>  ON a.F1 = b.F1 
>  WHERE a.F2 = 1 
> 
>I don't know when I've use a.F2 = 1 
>1) In the INNER JOIN statement OR 
>2) In the WHERE condition 
> 
>I appreciate any idea 
>Thanks a lot 
 
Hi mariohiga, 
 
For an INNER JOIN, there's no difference. Use what you prefer best. 
 
I'd choose the latter, because I like to keep the join conditions in the 
JOIN clauses and the filter conditions in the WHERE clauses - but that's 
purely personal preference. 
 
--  
Hugo Kornelis, SQL Server MVP
 
  
Navigation:
[Reply to this message] 
 |