Re: Select into

From: Jean-Michel Chabanne <jeanmichel(dot)chabanne(at)free(dot)fr>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Select into
Date: 2001-12-06 21:43:15
Message-ID: 9uook6$rib$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

  • Select into at 2001-12-06 03:01:54 from Christopher Kings-Lynne

Browse pgsql-sql by date

  From Date Subject
Next Message Oleg Lebedev 2001-12-06 22:14:30 Re: view rules
Previous Message Ross J. Reedstrom 2001-12-06 21:32:28 Re: view rules