假设我执行如下查询:
select a.some_column
from table_a a
join table_b b
on b.id = a.b_id
left join table_c c
on c.id = a.c_id
h2将以哪种顺序锁定表格?
答案 0 :(得分:1)
对于连接,没有可靠的方法来判断或确保锁定表的顺序。如果您需要显式订单,则需要执行多个语句,例如
select * from table_a where ... for update;
select * from table_b where ... for update;