Re: Advice with an insert query

Поиск
Список
Период
Сортировка
От Andreas Gaab
Тема Re: Advice with an insert query
Дата
Msg-id 48DA836F3865C54B8FBF424A3B775AF66817B178CE@Exchange-Server
обсуждение исходный текст
Ответ на Advice with an insert query  (JORGE MALDONADO <jorgemal1960@gmail.com>)
Список pgsql-sql

INSERT INTO table1 (fld1, fld2, fl3)

VALUES (SELECT value1, fldx, fldy FROM table2);

 

should work,

 

Andreas

 

 

Von: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org] Im Auftrag von JORGE MALDONADO
Gesendet: Freitag, 7. Juni 2013 15:59
An: pgsql-sql@postgresql.org
Betreff: [SQL] Advice with an insert query

 

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 по дате отправления:

Предыдущее
От: JORGE MALDONADO
Дата:
Сообщение: Advice with an insert query
Следующее
От: Oliver d'Azevedo Cristina
Дата:
Сообщение: Re: Advice with an insert query