Add columns to table; insert values based on row

Поиск
Список
Период
Сортировка
От Rich Shepard
Тема Add columns to table; insert values based on row
Дата
Msg-id alpine.LNX.2.20.1811011316280.13759@salmo.appl-ecosys.com
обсуждение исходный текст
Ответы Re: Add columns to table; insert values based on row  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: Add columns to table; insert values based on row  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
   I have the following code in a script:

alter table stations add column start_date date;
alter table stations add column end_date date;
alter table stations add column howmany integer;
alter table stations add column bin_col char(8);

insert into stations (start_date, end_date, howmany, bin_col) values ( )
   select site_nbr from stations
     where site_nbr = ' ';

   The table has 82 rows. Is there a more elegant way to insert data specific
to a site_nbr other than 82 repetitions of the insert statement? (I suspect
not, but I might be wrong and learn something valuable by asking.)

Regards,

Rich


В списке pgsql-general по дате отправления:

Предыдущее
От: Ron
Дата:
Сообщение: Truncated queries in the pg_log file
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Add columns to table; insert values based on row