Re: Concatenate two tables

Поиск
Список
Период
Сортировка
От Harry
Тема Re: Concatenate two tables
Дата
Msg-id 20021208140302.14a0e10d.h3@x-maru.org
обсуждение исходный текст
Ответ на Concatenate two tables  (Alexander Pucher <pucher@atlas.gis.univie.ac.at>)
Список 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 по дате отправления:

Предыдущее
От: Alexander Pucher
Дата:
Сообщение: Concatenate two tables
Следующее
От: Oliver Elphick
Дата:
Сообщение: Re: Concatenate two tables