Re:

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re:
Дата
Msg-id Pine.BSF.4.21.0109031044040.76325-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на  ("Joseph Syjuco" <joseph@asti.dost.gov.ph>)
Список pgsql-sql
On Mon, 3 Sep 2001, Joseph Syjuco wrote:

> im new in postgresql (actually came from SQL Server) and i was trying a
> script like this
> 
> insert into table1(field1,field2) values (select field1, field2 from table
> 2);
> 
> i dont know if this is possible (inserting a set of entries via resultset
> from a select stmt in one command).  If anyone has any answers, or
> workarounds pls do email me

You can, but you don't need to use values.

insert into table1(field1, field2) select field1, field2 from table2;
should do what you want.



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

Предыдущее
От: Michael Davis
Дата:
Сообщение: Re:
Следующее
От: "Josh Berkus"
Дата:
Сообщение: Re: INSERT Syntax