Re: Concatenate two tables - Mailing list pgsql-novice

From Harry
Subject Re: Concatenate two tables
Date
Msg-id 20021208140302.14a0e10d.h3@x-maru.org
Whole thread Raw
In response to Concatenate two tables  (Alexander Pucher <pucher@atlas.gis.univie.ac.at>)
List pgsql-novice
On Sun, 08 Dec 2002 22:38:40 +0100
Alexander Pucher <pucher@atlas.gis.univie.ac.at> wrote:

> I have two tables with identical table stucture. How can i add all rows
> from table2 into table1, i.e concatenate the two tables.

I think following will accomplish this for you:

    insert into table1 select * from table2;

Or, if you want the concatenation of table1 and table2 in a new table:

    select * into table3 from
    (select * from table1 union select * from table2) as tmp

-Harry

pgsql-novice by date:

Previous
From: Alexander Pucher
Date:
Subject: Concatenate two tables
Next
From: Oliver Elphick
Date:
Subject: Re: Concatenate two tables