Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Diff. between UNION and UNION ALL
Hi Naren,
For example if you have two tables named T1 and T2, then
........................................... Table T1 table T2 --------- ----------- ename varchar2(12) name varchar2(12) A C B D
..........................................
SELECT ename FROM t1
UNION
SELECT name FROM t2
RESULT : A B C D ( DISTINCT VALUES)
.............................................
SELECT ename FROM t1
UNION ALL
SELECT name FROM t2
RESULT : A B C D C D ( including DUPLICATE VALUES).
............................................
Hope this helps
-- AMARENDRA B NETTEM ORACLE CONSULTANT WHITTMAN-HART INC., CHICAGO (http://www.iit.edu/~nettama) Naren Chintala <naren_at_mink.att.com> wrote in article <33173071.8F9_at_mink.att.com>...Received on Sat Mar 01 1997 - 00:00:00 CST
> Hi,
>
> What's the difference between UNION and UNION ALL (in a SELECT
> statement). I don't find any info on this in the Oracle manuals. Would
> someone explain this with a simple example.
>
> TIA
>
> Naren
>