sql语句写脚本,大神请进

麻烦给写个脚本
/****** Script for SelectTopNRows command from SSMS ******/
SELECT TOP 1000 [Name]
,[CtfId]
,[Gender]
,[Birthday]
,[Address]
,[Mobile]
,[Tel]
,[Fax]
,[EMail]
,[Family]
,[Version]
FROM [1234567].[dbo].[cdsgus]
上面的这个脚本只能显示前1000个,我想要显示为 500~700行数的数据,怎么写这个脚本!谢谢!

select t1.* from
(select t.*,row_number() over (order by id) rn from
(SELECT TOP 1000 [Name]
,[CtfId]
,[Gender]
,[Birthday]
,[Address]
,[Mobile]
,[Tel]
,[Fax]
,[EMail]
,[Family]
,[Version]
FROM [1234567].[dbo].[cdsgus]) t) t1
where rn between 500 and 700

其实后边有个id里,你可以根据那个来查

追问

执行不了啊!!

追答

你,浏览器右上角,查收一下

温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答