From: Deep on
Dear friends,
Inner join and self join both are same. Can you tell me why we
prefer inner join?

Thanks & Regards
Vinod kumar
From: Bob Barrows on
Deep wrote:
> Dear friends,
> Inner join and self join both are same. Can you tell me why we
> prefer inner join?
>
> Thanks & Regards
> Vinod kumar

Could you rephrase your question, please? Your subject line mentions inner
and equi joins, which indeed are the same, while your question here refers
to inner join and self-join, which do not have to be the same. Give an
example of each type of join you are asking about so we can be sure we
understand what you are asking about.


--
Bob Barrows


From: Deep on
On Jun 14, 12:10 am, "Bob Barrows" <reb01...(a)yahoo.com> wrote:
> Deep wrote:
> > Dear friends,
> >   Inner join and self join both are same. Can you tell me why we
> > prefer inner join?
>
> > Thanks & Regards
> > Vinod kumar
>
> Could you rephrase your question, please? Your subject line mentions inner
> and equi joins, which indeed are the same, while your question here refers
> to inner join and self-join, which do not have to be the same. Give an
> example of each type of join you are asking about so we can be sure we
> understand what you are asking about.
>
> --
> Bob Barrows

Sorry It was mistake.
I have to know that why inner join is better than equi join?
From: Erland Sommarskog on
Deep (vinodkus(a)gmail.com) writes:
> Sorry It was mistake.
> I have to know that why inner join is better than equi join?

The question is still meaningless. The question is like why is better
to drive a Mercedes than a diesel car. That is, there are Merecedes
models than runs on diesel.

An equi-join is a join where you join two columns on equality. An equi-
join can be an inner join or an outer join.

And whether you use an equi-join or a non-equi-join, and whether you
use an inner join or an outer join, depends on the problem you are
trying to solve.


--
Erland Sommarskog, SQL Server MVP, esquel(a)sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

From: Bob Barrows on
Deep wrote:
> On Jun 14, 12:10 am, "Bob Barrows" <reb01...(a)yahoo.com> wrote:
>> Deep wrote:
>>> Dear friends,
>>> Inner join and self join both are same. Can you tell me why we
>>> prefer inner join?
>>
>>> Thanks & Regards
>>> Vinod kumar
>>
>> Could you rephrase your question, please? Your subject line mentions
>> inner and equi joins, which indeed are the same, while your question
>> here refers to inner join and self-join, which do not have to be the
>> same. Give an example of each type of join you are asking about so
>> we can be sure we understand what you are asking about.
>>
>
> Sorry It was mistake.
> I have to know that why inner join is better than equi join?

As Erland says, your question is still meaningless (and thanks, Erland,
for the gentle comeuppance re. my agreement that inner and equi-joins
are the same: of course they are not).

Vinod, are you talking about the ANSI-style syntax (from t1 join t2 on
<join_criteria>) vs. the old-style non-ANSI syntax (from t1,t2 where
<join_criteria mixed with filter_criteria>)? If so, you can look in
Books Online which covers this pretty well (to make a long story short:
no difference with inner joins, different results with outer joins
depending on whether the join_criteria are put in the ON clause or the
WHERE clause).


--
HTH,
Bob Barrows