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

Home -> Community -> Usenet -> c.d.o.server -> sql question

sql question

From: Guruju,Narendra <NGURUJU_at_cerner.com>
Date: Mon, 6 Aug 2001 14:49:21 -0500
Message-ID: <D15ED542E12BD3119FFE00805F6551F00BFFA470@mailwhqnews.cerner.com>

Hello,

        I am looking at some of the sql scripts here at my new job and noticed queries like  

SELECT /*+ RULE */
      pa2.alias
    FROM

      person p,
      person_alias pa1,
      person_alias pa2
    WHERE 
      p.person_id = pa1.person_id and
      pa1.alias = x
      and pa1.person_id = pa2.person_id
      and p.person_id = pa1.person_id(+)

Is there any important reason that a table is being joined to itself. I have seen several queries where the same table with different aliases has been defined in the from clause and a self join performed on it. These queries were written to run against the early versions of Oracle 7. I don't know if there is any performance gain by doing this.

Thanks,
Narendra Received on Mon Aug 06 2001 - 14:49:21 CDT

Original text of this message

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