码迷,mamicode.com
首页 > 其他好文 > 详细

with as的用法

时间:2016-07-14 01:56:08      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:

;with T1
as
(
select FTP_ID,FTP_NAME,FTP_Server,FTP_Port,FTP_UserID,FTP_Password from FTP_Config with(nolock)
where 1=1 {0}),T2 as
(
select *, row_number() over (order by {1} {2}) RowNum
from T1
),T3 as
(
select *,(select max(RowNum) from T2) maxnum from T2
where rownum between @pageS and @pageE
)
select a.* from T3 a order by a.RowNum

with as的用法

标签:

原文地址:http://www.cnblogs.com/xiatianoo/p/5668077.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!