Re: Concatenate two tables

From: Harry <h3(at)x-maru(dot)org>
To: Alexander Pucher <pucher(at)atlas(dot)gis(dot)univie(dot)ac(dot)at>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Concatenate two tables
Date: 2002-12-08 22:03:02
Message-ID: 20021208140302.14a0e10d.h3@x-maru.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Sun, 08 Dec 2002 22:38:40 +0100
Alexander Pucher <pucher(at)atlas(dot)gis(dot)univie(dot)ac(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Oliver Elphick 2002-12-08 22:08:52 Re: Concatenate two tables
Previous Message Alexander Pucher 2002-12-08 21:38:40 Concatenate two tables