Re: Ok, what am I doing wrong here?

Поиск
Список
Период
Сортировка
От Tomasz Myrta
Тема Re: Ok, what am I doing wrong here?
Дата
Msg-id 403242A6.4040302@klaster.net
обсуждение исходный текст
Ответ на Ok, what am I doing wrong here?  (Karl Denninger <karl@denninger.net>)
Список pgsql-sql
Dnia 2004-02-17 17:02, Użytkownik Karl Denninger napisał:
> I want to insert values from one table into another, and add some "default"
> values (that are not defaults on the table different reasons - that is, this
> is maintenance function and in normal operation there would be "real" values
> there - and null is valid)
> 
> So, I want to do, for example, the following:
> 
> insert into table (id, time, type) values (select id, now(), '1' from secondtable);

Documentation says:
INSERT INTO table [ ( column [, ...] ) ]    { DEFAULT VALUES | VALUES ( { expression | DEFAULT } [, ...] ) | 
SELECT query }

insert into table (id, time, type)
select id, now(), '1' from secondtable;

Regards,
Tomasz Myrta


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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Ok, what am I doing wrong here?
Следующее
От: Karl Denninger
Дата:
Сообщение: Re: Ok, what am I doing wrong here?