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: Adding rows from two tables into a new table.

Re: Adding rows from two tables into a new table.

From: Arati Vijay <vijayj_at_singnet.com.sg>
Date: Sun, 3 Oct 1999 16:08:40 +0800
Message-ID: <7t7357$l1f$1@coco.singnet.com.sg>

SELECT col1, col2 FROM table1
UNION
SELECT col1, col2 FROM table2

<screwbai_at_my-deja.com> wrote in message news:7t5eau$v9u$1_at_nnrp1.deja.com...
> I have two table that I want to add the rows together into one table.
>
> Example
>
> table1:
> -------
> A B
> C D
>
> table2
> ------
> E F
> G H
>
> Then I want to end up with a table that has all four rows in it like
> this.
> tableresult:
> --------
> A B
> C D
> E F
> G H
>
> I can acomplish this by creating a temporary table and select into it.Or
> having a permanet table that I truncate everytime I execute the process.
> I am using a the tableresult as a virtual table in a cursor. So I am
> trying to avoid the use of temporary tables. Can something like this be
> done in a select statement.
>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Sun Oct 03 1999 - 03:08:40 CDT

Original text of this message

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