标签:select with from next etc fetch alc pre code
count(1)不要和查询数据混用 非常耗时
SELECT w.[PKID],
COUNT(1) OVER() AS TotalCount
FROM w WITH(NOLOCK)
INNER JOIN s WITH(NOLOCK)
ON s.PKID= w.SID
INNER JOIN s2 WITH (NOLOCK)
ON s2.PKID= w.SID2
INNER JOIN w2 AS WTLWITH(NOLOCK)
ON W2.WID=w.PKID
ORDER BY w.PKID
OFFSET 0 ROW FETCH NEXT 15 ROW ONLY
标签:select with from next etc fetch alc pre code
原文地址:http://www.cnblogs.com/Lulus/p/7905338.html