Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: A question about performing UPDATE and multiple tables
On Sep 10, 9:21 am, Brian Tkatch <N/A> wrote:
> On Fri, 07 Sep 2007 13:15:43 -0400, Ubiquitous <web..._at_polaris.net>
> wrote:
>
[]
> >Can someone point me to where I can find the differences between a join and a UNION of two tables?
> >I'm curious...
>
> UNION and a join are two different animals. UNION appends the records
> from the second query onto the result set of the first query. A join
> makes it as if it were wider TABLE.
>
> B.
Another way to think of it:
UNION is an addition operation
JOIN is a multiplication operation.
Consider tables A (6 rows) and table B (5 rows) both with columns PK
and DPEND
then
SELECT * FROM A
UNION
SELECT * FROM B;
yields a result set with 2 columns and 11 rows
but
SELECT * from A , B
(i.e a full join)
produces a result set with 4 columns and 30 rows.
HTH,
Ed
Received on Thu Sep 13 2007 - 22:05:35 CDT