比如:select a.name , b.je , b.id , b.bz , b.lx from tab01kh a , t02iccard b where a.id =b.kh_id and b.iccard ='0000005395' and b.xlh ='7FE31C2' and b.bz < 2
上面语句查询时,如果此时其它客户向a或b表插入数据或更新数据、查询数据,是否会产生阻塞?
...全文
484410打赏收藏
select 语句会对数据加锁吗?
比如:select a.name , b.je , b.id , b.bz , b.lx from tab01kh a , t02iccard b where a.id =b.kh_id and b.iccard ='0000005395' and b.xlh ='7FE31C2' and b.bz < 2 上面语句查询时,如果此时其它客户向a或b表插入数据或更新数据、查询数据,是否会产生阻塞?
取决于你的隔离级别,默认是加S锁的。
When you don’t want that readers are acquiring S locks (which isn’t really recommended), you can use the Isolation Level Read Uncommitted.
select a.name , b.je , b.id , b.bz , b.lx from tab01kh a (NOLOCK), t02iccard b (NOLOCK) where a.id =b.kh_id and b.iccard ='0000005395' and b.xlh ='7FE31C2' and b.bz < 2