Re: Subquery in INSERT? - Mailing list pgsql-novice

From A. Kretschmer
Subject Re: Subquery in INSERT?
Date
Msg-id 20061017121321.GE19268@a-kretschmer.de
Whole thread Raw
In response to Subquery in INSERT?  ("Wilfred Benson" <hairymcfarsen@hotmail.com>)
List pgsql-novice
am  Tue, dem 17.10.2006, um  5:06:59 -0700 mailte Wilfred Benson folgendes:
> What I'm trying to do is copy a value from one column to another in the
> same table. The table looks like this:
>
>  first | second
> ---------------------
> 1      |
> 2      |
> 3      |
> 4      |
> ...
>
> It's named 'copier'.
>
> The first column is sequence-generated, and the second has yet to have
> anything loaded (at this stage it's only a test table). So what I'm trying
> to do is quick copy of '1' from 'first' to 'second' with this query:

update copier set second = first;


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47215,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

pgsql-novice by date:

Previous
From: "Wilfred Benson"
Date:
Subject: Subquery in INSERT?
Next
From: Shane Ambler
Date:
Subject: Re: Subquery in INSERT?