Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: When to use inner join

Re: When to use inner join

From: Galen Boyer <galen_boyer_at_yahoo.com>
Date: 23 Mar 2006 18:01:02 -0600
Message-ID: <uhd5ofsl9.fsf@rcn.com>


On Thu, 23 Mar 2006, m.tonies_at_upscene.removethis.com wrote:
>

>> There are two queries:
>> 1. SELECT
>>        RR.*, a.NAME
>> FROM
>>  T_test1 RR  INNER JOIN
>>  T_test2 A
>>  ON
>>  A.CODE =RR.LOCCODE
>>
>> 2.SELECT
>>        RR.*, a.NAME
>> FROM
>>  T_test1 RR , t_test2 a where A.CODE =RR.LOCCODE
>>
>> they are giving the same recordset.
>> --> when to use Inner join
>> -->Is there any diff. b/w these two queries

>
> In addition to Sims' answer, I would say that the query
> with the explicit JOIN is easier to read.
>
> It will also be more clear if you add joined tables or
> modify it to an outer join.
>
> Oh, and the explicit JOIN syntax is the SQL 92 and up
> syntax, while writing everything in the WHERE is the
> SQL89 syntax.

The biggest win for me is that the tables I'm joining and the criteria I'm using to join are in the same place. I don't have to visually scan the where criteria and keep my place, I put the tables and criteria together. Once I coded a few INNER JOINS and LEFT OUTER JOINS I was hooked.

-- 
Galen Boyer
Received on Thu Mar 23 2006 - 18:01:02 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US