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
学习
相关问答:
with adod_dict do
begin
close;
commandtext:='select bgqxcode,count(*) wjsl from wscl_wsda_file where wjnd=:tnd group by bgqxcode'; ......
大家帮忙看看这2个sql语句哪个查询的速度更快点。谢谢帮忙。比较着急。在做性能测试。
select * from
表A LEFT OUTER JOIN 表B ON (表A.id || ' ' =表B.id) ,表C , 表D, 表E
Where其他条件
select * ......
环境: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 ......
(1)string ConnString = "server=localhost;integrated security=sspi;database=pubs;";
(2)string strConnection="user uid=sa;pwd=123456;Database=test;Server=test;Connect ......