Re: INSERTS and Queries

From: Russ Brown <postgres(at)dot4dot(dot)plus(dot)com>
To: C G <csgcsg39(at)hotmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: INSERTS and Queries
Date: 2004-03-01 13:44:27
Message-ID: opr36q4dsm6sifx0@relay.plus.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 01 Mar 2004 13:36:35 +0000, C G <csgcsg39(at)hotmail(dot)com> wrote:

> Dear All,
>
> I can use insert with 'select' if I do this
>
> INSERT INTO TABLE t1 (col1) SELECT stuff FROM t2;
>
> But I want to insert more than one thing into the table, e.g.
>
> INSERT INTO TABLE t1 (col1,col2) SELECT stuff FROM t2 , 100;
>
> Any ideas on how I would achieve this?
>

INSERT INTO TABLE t1 (col1,col2) SELECT stuff, 100 FROM t2;

> Thanks
>
> Colin
>
> _________________________________________________________________
> Express yourself with cool emoticons - download MSN Messenger today!
> http://www.msn.co.uk/messenger
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nick Barr 2004-03-01 13:49:16 Re: INSERTS and Queries
Previous Message C G 2004-03-01 13:36:35 INSERTS and Queries