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

How to select all columns and insert into other table

From: A B <gentosaker(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: How to select all columns and insert into other table
Date: 2010-02-18 10:10:32
Message-ID: dbbf25901002180210n4dc9d668t635fab34fc6cedba@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
Hello.

If tableA and tableB have the same columns but in differrent order

Is there a way to get

INSERT INTO tableA  SELECT * FROM tableB  LIMIT 1;

to work, that is, get the value in column  X to be placed in the
corresponding column in tableA  without listing all the columns?

Responses

pgsql-novice by date

Next:From: Jayadevan MDate: 2010-02-18 10:13:28
Subject: Re: How to select all columns and insert into other table
Previous:From: Richard HuxtonDate: 2010-02-18 10:04:50
Subject: Re: Define permissions at database level

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