Mysql语法帮助
查询:
select t1.col1
from table1 t1
inner join with (nolock) table2 t2 on t1.col2 = t2.col1
我尝试在 mySQL 数据库中使用 nolock 选项来优化查询,但由于某种原因,上述查询 不起作用,我收到的错误是
您的 SQL 语法有错误;
有什么想法吗?
Query:
select t1.col1
from table1 t1
inner join with (nolock) table2 t2 on t1.col2 = t2.col1
Am trying to use nolock option for optimized query in mySQL db, but for some reason the above query
does not work and the error i receive is
You have an error in your SQL syntax;
Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
MySQL 不支持
with (nolock)
,这是 SQL Server 的问题。这是一篇讨论在 MySQL 中获得等效效果的文章: MySQL with nolock< /a>
MySQL doesn't support
with (nolock)
, that's an SQL Server thing.Here's an article talking about getting an equivalent effect in MySQL: MySQL with nolock
WITH(NOLOCK)
似乎在 MSSQL 中 (参见 MSDN)在 MySQL InnoDB 中,您有等效的
SET [GLOBAL | SESSION] 事务隔离级别未提交读取
参见 MySQL论坛
WITH(NOLOCK)
seems to be in MSSQL (see MSDN)In MySQL InnoDB you have this equivalent
SET [GLOBAL | SESSION] TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
See on MySQL forums