Re: request for sql3 compliance for the update command

From: Mike Aubury <mike(at)aubit(dot)com>
To: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Hannu Krosing" <hannu(at)tm(dot)ee>
Cc: "Dave Cramer" <dave(at)fastcrypt(dot)com>, "Peter Eisentraut" <peter_e(at)gmx(dot)net>, "Pgsql Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: request for sql3 compliance for the update command
Date: 2003-02-20 19:09:54
Message-ID: 200302201909.54460.mike@aubit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Informix supports 2 different styles for the update - your one would have to
be written :

UPDATE djp SET(col1, col2) = ((SELECT col1,col2 FROM some_other_table))

Notice the double brackets !
The first signifies a list of values - the second is the brackets around the
subquery...

(NB If you try to reference the same table in the Update - you'll get an
error....)

For single columns you could still write :

UPDATE djp SET col1 = (SELECT col2 FROM some_other_table)

Notice - one more set of brackets on the right as on the left....

> UPDATE djp SET(col1, col2) = (SELECT col2, col1 FROM djp)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ross J. Reedstrom 2003-02-20 19:34:53 Re: Simplifying timezone support
Previous Message scott.marlowe 2003-02-20 18:13:36 Re: request for sql3 compliance for the update command