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: UNION and WHERE

Re: UNION and WHERE

From: Jeff Guttadauro <jeff109_at_NOSPAM.netscape.net>
Date: Thu, 13 Jan 2000 14:36:57 GMT
Message-ID: <387de0fd.2715795@news>


Sure you can...

SELECT field1, field2 FROM table1
WHERE field3 = 'something'
UNION
SELECT field1, field2 FROM table1
WHERE field3 = 'something else'

As long as the SELECT statements you are uniting ("UNION"ing) have field lists that have the same number of fields, each having the same type as its corresponding field in the other field list, a UNION will work. While the SELECT statements above are both from the same table, they can be from different tables. You could also combine more than two SELECT statements with UNION if you want. Check out the documentation for more info.

HTH,
-Jeff

On Thu, 13 Jan 2000 14:18:57 +0100, "Olivier BRUZEAUX" <obruzeau_at_telecom.capgemini.fr> wrote:

>Hi,
>
>Is it possible to use UNION and WHERE in the same statement !!
>If it is possible do you have an example,
>
>Thank you
>
>Olivier
>
>
Received on Thu Jan 13 2000 - 08:36:57 CST

Original text of this message

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