sql server 2008 rownumber 分页sql语句

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

sql server 2008 rownumber 分页sql语句

上一篇:SQL 联合索引 与 单一列的索引 比较


下一篇:C# 32位应用读写64位系统的注册表