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: select -> select

Re: select -> select

From: Arjan van Bentem <avbentem_at_DONT-YOU-DAREdds.nl>
Date: Wed, 12 Aug 1998 20:01:12 +0200
Message-ID: <6qsl82$7hl$1@newton.a2000.nl>


Normal SQL:

    select name, address
    from persons
    where name in
( select name

      from members
    );

or

    select temp.name, t1.address
    from persons t1,
( select name

      from members
    ) temp /* now you can refer to temp as a table */     where t1.name = temp.name;

Indeed, in PL/SQL you'd need a cursor when your query returns more than one row:

declare

    cursor c_names is
    ... /* one of the selects here */
begin

    for r in c_names
    loop

        if r.name ...

    end loop;
end;

Arjan. Received on Wed Aug 12 1998 - 13:01:12 CDT

Original text of this message

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