Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用 select for update 子句通过 union 锁定表。
这可能吗
select * from table_a,table_b where table_a.join_col=table_b.join_col for update table_a.col1 union select * from table_a
但这是不可能的,因为我们不能将 for update 与 union 一起使用。
你能帮我么。
Oracle 文档声称:
FOR UPDATE 子句的限制 此子句受以下限制: 您不能使用以下其他构造指定此子句:DISTINCT 运算符、CURSOR 表达式、集合运算符、group_by_clause 或聚合函数。