0

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?

OMG Ponies
  • 325,700
  • 82
  • 523
  • 502
Karthick
  • 17
  • 1

2 Answers2

7

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

Chad Birch
  • 73,098
  • 23
  • 151
  • 149
1

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

Serty Oan
  • 1,737
  • 12
  • 19