update query that works in both MYSQL and H2 -


i think have queries mysql , h2 both work can come 1 works on both?

the table has foreign key own primary key , want copy field value down heirarchy.

the mysql query looks this:

update data p, data c set c.field=p.field p.id=c.linkid , p.level = 0; 

the h2 query looks this:

update data c set c.field=(select p.field data p p.id=c.linkid , p.level=0) exists(select * data p p.id=c.linkid , p.level=0); 

the reason wanting common query production system mysql have unit tests in maven , want tests run anywhere , not have dependency on local mysql database.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -