sql server 2008 rownumber 分页sql语句 - zyf - 博客园

baacloud免费翻墙vpn注册使用

来源: sql server 2008 rownumber 分页sql语句 – zyf – 博客园

SELECT
ID,TSRID, plid,CustomerName,SellCode,Mobile ,ReserveTime,CrtTime,hjtime,jieshuma ,
InsureBillCode, tname,bname,shoucang,xingbie,ActivityName ,sydate,AddInsuranceID
FROM
———————————————–
(

SELECT *,ROW_NUMBER() OVER (ORDER BY hjtime desc) AS RowNo

FROM [C_V_SellData]

where
CrtUser=358
and StoreType=1
and EndCode <> 1
and EndCode <> 5
and hjtime  >= cast(convert(varchar,’2014/1/18′,111) as datetime)
and hjtime <  cast(convert(varchar,’2014/2/18′,111) as datetime) + 1
and isnull(AddInsuranceID,”)<>’N’  ) AS A

————————————————–
WHERE   RowNo>=1  and RowNo<=50

赞(0) 打赏
分享到: 更多 (0)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏