Re:

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Joseph Syjuco <joseph(at)asti(dot)dost(dot)gov(dot)ph>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re:
Date: 2001-09-03 17:45:45
Message-ID: Pine.BSF.4.21.0109031044040.76325-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

  • at 2001-09-03 09:02:36 from Joseph Syjuco

Browse pgsql-sql by date

  From Date Subject
Next Message Chris Ruprecht 2001-09-03 18:06:52 More on the TO DO wishlist
Previous Message Peter Eisentraut 2001-09-03 17:35:10 Re: