sql 获取第10到20个记录
2009-05-29 17:22
176 查看
select top 10 [time] ,currentprice from (select top 20 [time], currentprice from sh601398 where StockID='601939' order by [time] desc)bb order by [time] asc
select TOP 10 * from (select top 20 * from table order by XXX asc)
order by XXX desc
先取前20
再倒序取前10
如果要照10--20排序請再排序一次
select TOP 10 * from (select top 20 * from table order by XXX asc)
order by XXX desc
先取前20
再倒序取前10
如果要照10--20排序請再排序一次
相关文章推荐
- 灵动标签的用法 ecms通过执行sql获取需要的记录
- SQL中获取刚插入记录时对应的自增列的值
- MS SQL SERVER中如何快速获取表的记录总数
- SQL语句分组获取记录的第一条数据的方法
- SQL 分组后获取其中一个字段最大值的整条记录
- sql获取分组后取某字段最大一条记录
- SQL语句去掉重复记录,获取重复记录
- SQL脚本获取指定数据库的所有用户表记录数
- 使用SQL语句获取数据库中随机N个记录
- sql获取记录总数
- MS SQLSERVER中如何快速获取表的记录总数
- MS SQLSERVER中如何快速获取表的记录总数
- SQL获取刚插入的记录的自动增长列ID的值
- SQL 分组后获取其中一个字段最大值的整条记录
- SQL语句分组获取记录的第一条数据的方法
- 获取sql中前N条件记录
- MS SQLSERVER中如何快速获取表的记录总数
- sql获取随机记录(MYSQL,ACCESS,ORACLE,SQL Server)
- Open SQL 获取符合条件的记录
- MS SQLSERVER中快速获取表的记录总数