Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: select -> select
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
![]() |
![]() |