Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Q: select with set operators and brackets
Jörn Fieg wrote:
>
> Hi!
>
> Gombos Bertalan wrote:
>
> > Hi all!
> >
> > I would like to issue the following SELECT in PL/SQL:
> > (SELECT 1 FROM dual MINUS
> > SELECT 2 FROM dual)
> > UNION
> > (SELECT 3 FROM dual MINUS
> > SELECT 4 FROM dual)
> >
> > How I can do it? It works in SQL but (SELECT 1 INTO x ... ) doesn't work in
> > PL/SQL.
>
> First, if you use (SELECT 1 INTO x ... ) you'll try to fetch multiple rows into
> a single variable. That won't work at all in pl/sql. So you are in need of
> cursor.
Okay. I know that it raises an exception when result is not a single
row. My only goal is to compare two tables. I'm not intrested in any
other result. Supposing A and B are the tables to compare, (A minus B)
union (B minus A) is empty if tables equals. I would like to decide bye
one select.
Bye:
--
G o m b o s B e r t a l a n
system engineer, Oracle developer
mailto:bgombos_at_freemail.c3.hu
Received on Sat Nov 20 1999 - 05:09:46 CST