Oracle SQL:联接语句中的 NOLOCK

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38450638/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 03:16:20  来源:igfitidea点击:

Oracle SQL: NOLOCK in join statment

sqloraclejoinlocksread-uncommitted

提问by Naren Karanam

I can not use NOLOCK after table names in join statements. Is it even a valid scenario to try to read uncommitted data over JOINs

我不能在连接语句中的表名后使用 NOLOCK。尝试通过 JOIN 读取未提交的数据是否是一个有效的场景

回答by Gary Myers

The join is irrelevant. NOLOCK isn't used in Oracle. A query will only see committed data (plus any uncommitted changes in the transaction performing the query).

加入无关紧要。Oracle 中不使用 NOLOCK。查询只会看到已提交的数据(以及执行查询的事务中任何未提交的更改)。

You can write a query such as SELECT * FROM tbl NOLOCKbut NOLOCK is simply being used as a table alias and doesn't change the querying mechanism.

您可以编写诸如SELECT * FROM tbl NOLOCKNOLOCK 之类的查询,但 NOLOCK 只是用作表别名并且不会更改查询机制。