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: Martijn Tonies <m.tonies_at_upscene.removethis.com>
Date: Thu, 23 Mar 2006 13:54:11 +0100
Message-ID: <12256jreaecgd9c@corp.supernews.com>

> 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.

-- 
Martijn Tonies
Database Workbench - development tool for Oracle, and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
Received on Thu Mar 23 2006 - 06:54:11 CST

Original text of this message

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