Re: referencing other INSERT VALUES columns inside the insert

Поиск
Список
Период
Сортировка
От Geoff Winkless
Тема Re: referencing other INSERT VALUES columns inside the insert
Дата
Msg-id CAEzk6femufwosHW__YcMUFaKCqRqmPd++2Omp-cP5pMnZZQgkg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: referencing other INSERT VALUES columns inside the insert  (Albe Laurenz <laurenz.albe@wien.gv.at>)
Ответы Re: referencing other INSERT VALUES columns inside the insert  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
On 16 November 2015 at 10:55, Albe Laurenz <laurenz.albe@wien.gv.at> wrote:
What about something along these lines:

INSERT INTO test (c1, c2, c3)
   (WITH fixed(x1, x2) AS (VALUES (3, 7))
    SELECT x1, x2, x1 * x2 FROM fixed);

​Genius!

It never occured to me that the with_query parameter could be used that way. Thanks!

Geoff

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

Предыдущее
От: Albe Laurenz
Дата:
Сообщение: Re: referencing other INSERT VALUES columns inside the insert
Следующее
От: John R Pierce
Дата:
Сообщение: Re: DB_link connection