Re: Select into

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Select into
Дата
Msg-id 200401120945.18759.dev@archonet.com
обсуждение исходный текст
Ответ на Select into  (beyaRecords - The home Urban music <uzo@beya-records.com>)
Список pgsql-sql
On Monday 12 January 2004 01:09, beyaRecords - The home Urban music wrote:
> Hi,
> I want to copy a sequence of rows from one table into another table. I
> have tried select into but this will only work if the table you are
> copying to does not already exist. How do I copy to a table that does
> already exist?

Something like:

INSERT INTO table_a (a,b,c)
SELECT d,e,f FROM table_b WHERE f=1;

You could replace any of the columns in the SELECT by an expression if you 
wanted to.

--  Richard Huxton Archonet Ltd


В списке pgsql-sql по дате отправления:

Предыдущее
От: azwa@nc.com.my
Дата:
Сообщение: Insert into
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Unique key field or serverl fks ?