Hi Ho!
--- On Thu, 2/26/09, Craig Ringer <craig@postnewspapers.com.au> wrote:
> Eus wrote:
> > Hi Ho!
> >
> > Since I can do:
> >
> > INSERT INTO table (SELECT a_transaction.*);
> >
> > I am wondering whether I can do:
> >
> > UPDATE table SET (SELECT a_transaction.*) WHERE
> primary_key = (SELECT a_transaction.primary_key);
>
> UPDATE table SET fieldname = (SELECT ..) WHERE primary_key
> = (SELECT...)
Is it possible to eliminate the use of `fieldname' completely?
So, I just need to type `UPDATE table SET (SELECT ...) WHERE primary_key'.
I think this should be possible because if the subquery in the SET clause returns the same number of columns with the
sametypes of those of the destination table, PostgreSQL should be able to just update the values at once.
Thanks.
> --
> Craig Ringer
Best regards,
Eus (FSF member #4445)
In this digital era, where computing technology is pervasive, your freedom depends on the software controlling those
computingdevices.
Join free software movement today! It is free as in freedom, not as in free beer!
Join: http://www.fsf.org/jf?referrer=4445