| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера