Re: UPDATE ... FROM vs standard SQL

From: "Josh Berkus" <josh(at)agliodbs(dot)com>
To: Richard Huxton <dev(at)archonet(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: UPDATE ... FROM vs standard SQL
Date: 2002-06-07 15:20:08
Message-ID: web-1502464@davinci.ethosmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Richard,

> I've been happily using statements like
> UPDATE a SET flag=1 FROM b WHERE a.id=b.id AND b.foo='x';
>
> While PG's FROM extension makes life simple, I can't believe there's
> not a way
> to do an update on a join using standard SQL. The two options I can
> think of

I don't understand why you're worried about this. The lack of UPDATE
.. FROM is widely regarded as an omission by the ANSI committee, and
most SQL RDBMS support it, including MS SQL Server and Oracle. I'm not
sure about MySQL, but MySQL doesn't support sub-selects either.

Is there a database you're tinking of that sticks to the strict SQL92
definitions? OpenBase, maybe?

-Josh Berkus

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2002-06-07 15:21:29 Re: PL/pgSQL TODO
Previous Message Josh Berkus 2002-06-07 15:14:53 Re: PL/pgSQL TODO