當with和as一起用時,表示定義一個SQL字句 例: with sonword as ( select * from person ) select * from student where name in (select name from sonword) 相當於 select * from ...
當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的查詢性能,解決阻塞死鎖,但有可能造成臟讀等數據問題