ACCESS数据库 做分页写SQL的问题
select top 20 * from tb
where 字段名 not in
(select top 10 字段名 from tb)
我知道用这种方法可以得到10-20的数据
但是如果数据很多
比如select top 100020 * from tb
where 字段名 not in
(select top 100010 字段名 from tb)虽然可以得到100010-10020这10条数据 但是速度很慢 因为要打开前100020和10010的数据并且比较
请问大家在使用access数据库是如何分页的
因为是access当然没有sqlserver那么多函数了
LS?
表中建一个自增列,然后根据页数和页大小,计算出自增列的值范围。这样效率应该好很多。
2l的 你的那是啥东西
access的不会,帮顶.
lkjhlkjhjkhjk
需要在ID排序字段是有索引。
SQL code:
select top 10 *
from (
select top 10000 *
from tbl01
order by id
) order by id desc
或者这样 或许会快上一些。
SQL code:
select top 10 * from tbl01
where id>(select max(id) from (
select top 10000 *
from tbl01
order by id ))
order by id
学习
相关问答:
....接到一个小程序..工作原来大概是这样的...前台是WEB服务器.架构就是ASP+SQL..前台由ASP向SQL添加服务类别(表单).然后又后台程序读取表单..要实时读取..然后显示在服务器上面..从理论上面能行通不?如果可以..后台 ......
with adod_dict do
begin
close;
commandtext:='select bgqxcode,count(*) wjsl from wscl_wsda_file where wjnd=:tnd group by bgqxcode'; ......
DateTime startTime=DateTime(em_1.Text)
DateTime endTime=DateTime(em_2.Text)
string sql
sql = dw_1.GetSQLSelect()+"Where (StartTime> '"+startTime+"') and (EndTime ......
环境:1.win2003server+oracle9i
2.oracle9i字符集为AMERICAN_AMERICA.WE8ISO8859P1
3.oracle sql developer版本 1.5.5
现象描述: 1.在sql developer 中查询oracle中的某个表,中文全部显示为乱码。
......
table1
名称 入库数
CT机 3
CT机 5
X光机 4 ......