Re: Insert values from one existing table into a new table. - Mailing list pgsql-sql

From Wilco Boschman
Subject Re: Insert values from one existing table into a new table.
Date
Msg-id 3bf1920f$0$201$e4fe514c@newszilla.xs4all.nl
Whole thread Raw
List pgsql-sql
Assuming that the structure of the tables are identical, you could do a:

insert into new_table select * from some_table;

If they are not the same you could do a:

insert into new_table (column1, column2) select column1, column2 from some_table;

Cheers,

Wilco Boschman


"Jason" <jzhu@dental.temple.edu> schreef in bericht
news:9srij6$gre$1@cronkite.temple.edu...
| I want to insert the existing values of one table into a new table.  It
| needs the combination of  these to sql commands:
|
| "  insert into new_table values ( values_of_AtrributeA,
| values_of_AttributesB) "
| " select AttributeA, AttributeB from some_table "
|
| Thanks for your suggestions!  -- Jason
|
|
|




pgsql-sql by date:

Previous
From: "Aasmund Midttun Godal"
Date:
Subject: Unable to use '-' in column names in PLPGSQL
Next
From: "Ilker Egilmez"
Date:
Subject: problem: index on number not honoured