You are here: Re: About Join OR Where « MsSQL Server « IT news, forums, messages
Re: About Join OR Where

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация