pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jean-Michel Chabanne <jeanmichel.chabanne@free.fr>
To: pgsql-sql@postgresql.org
Subject: Re: Select into
Date: Thu, 6 Dec 2001 22:43:15 +0100
Message-ID: <9uook6$rib$1@news.tht.net> (raw)
References: <GNELIHDDFBOCMGBFGEFOKEKLCAAA.chriskl@familyhealth.com.au>

Christopher Kings-Lynne wrote:

> Hi All,
> 
> Is it possible to insert into a table based on a select from another
> table?
> 
> The docs for SELECT INTO and like seem to imply you can only create a
> table based on a select, not append to an existing table.
> 
> How do you do this?
> 
> Chris
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://archives.postgresql.org
> 

You have to use another syntaxe form :

INSERT INTO target_table (COLx,COLy....) select COLa,COLB... from 
source-table [where ...]

-- 
Jean-Michel Chabanne
77450 MONTRY (FRANCE)
48" 54' N - 2" 49' E
Powered by Linux



view thread (43+ messages)  latest in thread

Message-ID: <9uook6$rib$1@news.tht.net>
Permalink:  ../9uook6$rib$1@news.tht.net/
Also on:    postgresql.org/message-id/9uook6$rib$1@news.tht.net

 · 

reply

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: jeanmichel.chabanne@free.fr
  Subject: Re: Select into
  In-Reply-To: <9uook6$rib$1@news.tht.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