Search Postgresql Archives

Re: referencing other INSERT VALUES columns inside the insert

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 16 November 2015 at 10:55, Albe Laurenz <laurenz.albe@xxxxxxxxxx> 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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux