Re: Copying rows between tables?

From: Reinoud van Leeuwen <reinoud(dot)v(at)n(dot)leeuwen(dot)net>
To: Postgres-SQL <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Copying rows between tables?
Date: 2004-01-13 16:32:26
Message-ID: 20040113173226.X66382@spoetnik.xs4all.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, Jan 13, 2004 at 09:23:48AM -0700, Steve Wampler wrote:
>
> I know I can select from one table into a new table, but is
> there a way to select from one table into an existing table
> (aside from copying everything to a file, editing the file
> and then copying from that file)? Without destroying existing
> entries, of course...

insert into desttable (col1, col2, col3)
select col1, col2, col3 from sourcetable
where somecol = somevalue;

--
__________________________________________________
"Nothing is as subjective as reality"
Reinoud van Leeuwen reinoud(dot)v(at)n(dot)leeuwen(dot)net
http://www.xs4all.nl/~reinoud
__________________________________________________

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bing Du 2004-01-13 17:28:41 can insert 'null' into timestamp type field from command line but not from input file?
Previous Message Viorel Dragomir 2004-01-13 16:30:47 Re: Copying rows between tables?