Skip site navigation (1) Skip section navigation (2)

Re: Copying

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: Jake Stride <nsuk(at)users(dot)sourceforge(dot)net>
Cc: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Copying
Date: 2004-09-10 06:58:37
Message-ID: D6B5DF48-02F6-11D9-A626-000A95C88220@myrealbox.com (view raw or flat)
Thread:
Lists: pgsql-novice
On Sep 10, 2004, at 3:36 PM, Jake Stride wrote:

> What I want to be able to do is:
>
> SELECT name, 3 FROM assets <<INTO>> assets
>
> Since id is a serial/has a default value you don't need to worry about 
> it
> (iei the database should take care of it).

I think what you want to do is something along the lines of

INSERT INTO assets (name, jobno)
	SELECT distinct name, 3
	FROM assets
;

Michael


In response to

  • Copying at 2004-09-10 06:36:17 from Jake Stride

pgsql-novice by date

Next:From: operationsengineer1Date: 2004-09-10 09:12:41
Subject: Opinions Requested - PG API or Abstraction Layer
Previous:From: Jake StrideDate: 2004-09-10 06:36:17
Subject: Copying

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group