当前位置:Gxlcms > 数据库问题 > sql语句with as 和with(nolock)

sql语句with as 和with(nolock)

时间:2021-07-01 10:21:17 帮助过:95人阅读

当with和as一起用时,表示定义一个SQL字句

例:

with
sonword as
(
select * from person 
)
select * from  student
where name in (select name from sonword)

相当于

select * from  student
where name in (select name from person)

with(nolock)

一般用于select语句中,可以读取被事务锁定的数据

能提升sql的查询性能,解决阻塞死锁,但有可能造成脏读等数据问题

sql语句with as 和with(nolock)

标签:解决   提升   sel   定义   lock   阻塞   问题   bsp   where   

人气教程排行