Re: INSERT INTO ... SELECT - Mailing list pgsql-sql

From Jonathan Gardner
Subject Re: INSERT INTO ... SELECT
Date
Msg-id 200308120940.03131.jgardner@jonathangardner.net
Whole thread Raw
In response to INSERT INTO ... SELECT  (Silke Trissl <trissl@informatik.hu-berlin.de>)
List pgsql-sql
-----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)
SELECT1, 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-----


pgsql-sql by date:

Previous
From: Christopher Browne
Date:
Subject: Re: INSERT INTO ... SELECT
Next
From: Jonathan Gardner
Date:
Subject: Re: optimisation of a code