如题:
在Delphi+Access的环境下
表中有多个字段:A1    B1   A2     B2   A3    B3    A4    B4 ...
80.1  1    75.32  2    50.3  5    69.43  3  ...
73.22 3   63.5    3   64.34  4    54.78  4  ...
.     .    .      .    .     .      .    . 
.     .    .      .    .     .      .    .B1是根据A1得到排序结果,B2是根据A2得到排序结果,B3是根据A3排序结果...,有十个字段需要这样排序问:有什么方法能快速得到结果?

解决方案 »

  1.   

    为什么不A1\A2\……顺序的排列那?非要再加上一个B1....N
    这个用冒泡就可以,O(N^2)...
      

  2.   

    select * from 表名 order by 字段1,字段2,...
    用SQL语句即可排序。
      

  3.   

    这个能查出A1、B1、A2、B2
    select A1,(select count(*) from urtable where id<a.A1) as B1,A1,(select count(*) from urtable where id<a.A2) as B2 from urtable a另外你也可以用临时表
      

  4.   

    是我没有说清?
    字段名  A1    B1   A2     B2   A3    B3    A4    B4 ...  
    记录   80.1  1    75.32  2    50.3  5    69.43  3  ...
           73.22 3   63.5    3   64.34  4    54.78  4  ...
           .     .    .      .    .     .      .    . 
           .     .    .      .    .     .      .    .
    我想要快速排序的方法。
      

  5.   

    order by 不是你想要的么?那就用临时表吧