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
Post a Comment