From: Jonathan Gardner <jgardner@jonathangardner.net>
To: Silke Trissl <trissl@informatik.hu-berlin.de>
To: pgsql-sql@postgresql.org
Subject: Re: INSERT INTO ... SELECT
Date: Tue, 12 Aug 2003 09:40:01 -0700
Message-ID: <200308120940.03131.jgardner@jonathangardner.net> (raw)
In-Reply-To: <3F376E13.7080907@informatik.hu-berlin.de>
References: <3F376E13.7080907@informatik.hu-berlin.de>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Monday 11 August 2003 03:21, Silke Trissl wrote:
>
> Is there something like
>
> INSERT INTO test_table (int_id, cust_id, cust_name) '1', SELECT id,
> name from CUSTOMER:
>
> and if so, what ist the correct statement? If not, what is an
> alternative to insert a single row at a time?
>
I'm not too sure on what you want, but I'll guess.
INSERT INTO test_table
(int_id, cust_id, cust_name)
SELECT
1, id, name
FROM customer;
Does this do what you want?
- --
Jonathan Gardner <jgardner@jonathangardner.net>
Live Free, Use Linux!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE/ORhhWgwF3QvpWNwRAsoTAJ9Wq+iZ3/JbapXeS1wrv9VgR1gtAgCfVItU
ZsBeXCPBuLuOgBTWn3vu2Gc=
=PJDU
-----END PGP SIGNATURE-----
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: jgardner@jonathangardner.net, trissl@informatik.hu-berlin.de
Subject: Re: INSERT INTO ... SELECT
In-Reply-To: <200308120940.03131.jgardner@jonathangardner.net>
* 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