我ACCESS 有张表 A1 里面的类容如下PKID Name Sex Age
1    张飞  男  1
2    赵云  男  20
3    关羽  男  18
4    刘备  男  5
5    貂蝉  女  15
6    小乔  女  15
7    周瑜  男  15
8    大乔  女  15
9    曹操  男  203条分页按 Age 排序。ACCESS 不知道怎么弄,跟SQL 的不一样。弄了很多次都没弄出来,求帮忙下。急。

解决方案 »

  1.   

    PKID Name Sex Age
    1 张飞 男 1
    2 赵云 男 20
    3 关羽 男 3
    4 刘备 男 5
    5 貂蝉 女 15
    6 小乔 女 15
    7 周瑜 男 15
    8 大乔 女 15
    9 曹操 男 3
    改下数据是这样的,
    我写的SQL语句是
    select * from (select top 3 * from A1 where PKID not in(select top 3 PKID from A1 order by PKID)order by PKID asc) A1 order by Age asc
    查询出来不对,请高手指点下
      

  2.   

    select top 3 * from (select * from a order by age asc)a where pkid not 
    in(select top 6 pkid from (select * from a order by age asc) b )
      

  3.   

    select top 3 * from A1 where id not in (select id from A1 order by age) order by age
      

  4.   

    select top 3 * from A1 where id not in (select top 0 id from A1 order by age) order by age
      

  5.   

    select top 3 * from (select * from a order by age asc)a where pkid not  
    in(select top 6 pkid from (select * from a order by age asc) b )但是access还要用一个  如果查询条数没有3条时,就会出错!   需要判断一下!
      

  6.   

    select top 5 * from Tb where UserId not in
    (select top (n-1)*5 UserID from Tb order by Age asc)
    order by Age  asc