Re: Advice with an insert query

Поиск
Список
Период
Сортировка
От Oliver d'Azevedo Cristina
Тема Re: Advice with an insert query
Дата
Msg-id 6B78B72D-0B1E-4CBC-A9D5-9029A5C4CED5@gmail.com
обсуждение исходный текст
Ответ на Advice with an insert query  (JORGE MALDONADO <jorgemal1960@gmail.com>)
Список pgsql-sql
Just pass the fixed value for inside the select subquery. 
Do this

INSERT INTO table1 fld1, fld2, fl3
VALUES  (SELECT value1, fldx, fldy FROM table2)

HTH

Best,
Oliver 



Enviado via iPhone

Em 07/06/2013, às 02:58 PM, JORGE MALDONADO <jorgemal1960@gmail.com> escreveu:

I need to insert records into a table where one value is fixed and 2 values come from a SELECT query, something like the following example:

INSERT INTO table1 fld1, fld2, fl3
VALUES value1, (SELECT fldx, fldy FROM table2)

Is this valid?

Respectfully,
Jorge Maldonado

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

Предыдущее
От: Andreas Gaab
Дата:
Сообщение: Re: Advice with an insert query
Следующее
От: Thomas Kellerer
Дата:
Сообщение: Re: Advice with an insert query