sql - HSQLDB update field of one table from field of another one -


trying this:

update table1 t1 set cost = t2.price table2 t2 t1.item_id = t2.item_id 

it's working on postgresql not working on hsqldb.

how fix script support working both on postgresql , hsqldb?

hsqldb not support update ... from statements. on hsqldb use merge statement instead. out of head, hoping not contain syntax errors:

 merge table1 using table2 on table1.item_id = table2.item_id     when matched update set table1.cost = table2.price 

unfortunately, of today postgres not seem support merge statement, similar upsert.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -