sql server2005的查询问题。

[复制链接]
查看11 | 回复3 | 2011-10-25 15:01:09 | 显示全部楼层 |阅读模式
select top 20* from stu where id in (select top 30 id from stu order by id desc)...
回复

使用道具 举报

千问 | 2011-10-25 15:01:09 | 显示全部楼层
selet * from ( select top 30 * from stu) where id not in (select top 10 id fromstu) 一般是用游标但是我不会...
回复

使用道具 举报

千问 | 2011-10-25 15:01:09 | 显示全部楼层
SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY id desc) rn,* FROM dbo.Sys_UserInfo)a WHERE a.rn>=10 AND a.rn<=30...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行