Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> sql question
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