Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: sql question
On Mon, 6 Aug 2001, NGURUJU_at_cerner.com wrote:
> 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.
In this case, it looks like a silly join. The outer join is silly as well, cause I believe Oracle will return the straight join.
Does this query return the same result?
SELECT /*+ RULE */
pa1.alias
FROM
person p, person_alias pa1 WHERE p.person_id = pa1.person_id and pa1.alias = x
-- Galen Boyer It seems to me, I remember every single thing I know.Received on Mon Aug 13 2001 - 22:44:14 CDT