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.


Reply via email to