首页 > 数据库技术 > 详细

sql语句with as 和with(nolock)

时间:2016-12-05 02:04:10      阅读:415      评论:0      收藏:0      [点我收藏+]

当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)

原文:http://www.cnblogs.com/shuangzimuchangzhu/p/6132328.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!