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'; ......
PB中开发的。
DateTime startTime=DateTime(em_1.Text)
DateTime endTime=DateTime(em_2.Text)
string sql
sql = dw_1.GetSQLSelect()+"Where (StartTime> '"+startTime+&q ......
我数据库是MSSQL的,昨天所有的表被注入JS脚本代码,有个不明白的地方来问问大家
我发现有些表我根本没使用,也没有入库的ASP页面和语句,它是咱个注入的呢?
貌似select语句是可以嵌套的吧?
可能是where ......
(1)string ConnString = "server=localhost;integrated security=sspi;database=pubs;";
(2)string strConnection="user uid=sa;pwd=123456;Database=test;Server=test;Connect ......
请问:
1,如何将一张dbf表导入到sql server2000中的一张表。使用DTS该怎样实现?
2,使用网上代码:
Insert Into Tb_cj Select * from openrowset('MSDASQL','Driver=Microsoft Visual FoxPro D ......