H2 update with join

后端 未结 1 1332
滥情空心
滥情空心 2021-01-11 14:28

As development DB I am using MySQL, and for tests I am using H2 database. The following script works in MySQL very well, but it is fails on H2.

UPDATE `table         


        
相关标签:
1条回答
  • 2021-01-11 15:29

    Try something like this:

    update table_a a
    set a.b_id = (select b.id from table_b b where b.a_id = a.id)
    where exists
    (select * from table_b b where b.a_id = a.id)
    
    0 讨论(0)
提交回复
热议问题