views:

33

answers:

2
+2  Q: 

Mysql syntax help

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?

+7  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

Chad Birch
Thanks a lot Chad.
Karthick
+1  A: 

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