From: Reinoud van Leeuwen <reinoud.v@n.leeuwen.net>
To: Postgres-SQL <pgsql-sql@postgresql.org>
Subject: Re: Copying rows between tables?
Date: Tue, 13 Jan 2004 17:32:26 +0100
Message-ID: <20040113173226.X66382@spoetnik.xs4all.nl> (raw)
In-Reply-To: <1074011028.18994.18.camel@weaver.tuc.noao.edu>
References: <1074011028.18994.18.camel@weaver.tuc.noao.edu>
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.v@n.leeuwen.net
http://www.xs4all.nl/~reinoud
__________________________________________________
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: reinoud.v@n.leeuwen.net
Subject: Re: Copying rows between tables?
In-Reply-To: <20040113173226.X66382@spoetnik.xs4all.nl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox