Is this not an extension to ANSI SQL ? If it is I would prefer not to have it 
to prevent creating database specific code. After all that is the purpose of an 
SQL standard.

 
On 1 Dec 2009, at 20:11, Franklin Schmidt wrote:

> Both Postgres and MySQL allow using a join in an update statements.
> For example, in Postgres I could do:
> 
> update totals
>       set total = total + increments.inc
>       from increments
>       where totals.id = increments.id
> 
> The closest one can come with H2 is:
> 
> update totals
>       set total = total + (select inc from increments where totals.id =
> increments.id)
>       where exists (select inc from increments where totals.id = 
> increments.id)
> 
> which is ugly and I think will do each join twice.  It would be nice
> if H2 had better syntax for this.
> 
> --
> 
> You received this message because you are subscribed to the Google Groups "H2 
> Database" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/h2-database?hl=en.
> 
> 

--

You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.


Reply via email to