Re: Insert values from one existing table into a new table.

Поиск
Список
Период
Сортировка
От Wilco Boschman
Тема Re: Insert values from one existing table into a new table.
Дата
Msg-id 3bf1920f$0$201$e4fe514c@newszilla.xs4all.nl
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: "Aasmund Midttun Godal"
Дата:
Сообщение: Unable to use '-' in column names in PLPGSQL
Следующее
От: "Ilker Egilmez"
Дата:
Сообщение: problem: index on number not honoured