如果你用的是SQL Server2k的话,
把你的字段结构及实例数据贴出来,或许我可以帮你:)

解决方案 »

  1.   

    PARTNO (int) 型字段名   NAME          PARTNO
    数据为:  aa               3
              bcd              1
              r                2
              ar               4
              .                .
              .                .
              .                .数据有很多 我想要的结果是
         PARTNO 列显示顺序为
          1,2,3...n,1,2,3...n,1,2,3...n
      

  2.   

    1,2,3...n,1,2,3...n,1,2,3...n????
    不是
    1,2,3...n?
      

  3.   

    select * from 表 order by PARTNO
      

  4.   

    我想这样的查询是可能的.1.首先可以抽象成一个排序问题,用C语言可以描述出来.
    2.利用游标语法来替换C语言中的index问题.但是会有很大的问题.
    效率问题--将集合操作转化为表的操作,关系代数中不直接支持这样的演算,而且游标性能很低建议将数据集取出来,在前台程序中进行控制输出.
      

  5.   

    1, 在表中加主键 ID (本身应有一个主键吧?)2、
    create table #Temp
    (PKID int identity(1,1), 
    ID int )
    do while (exists( select * from tableName where ID not in (select ID from #temp)))
    begin
    insert #temp
    select min(id) id FROM tableName 
    where ID not in ( select ID from #temp)
    group by partionNO
    end
    --此时其顺序已经保存在表#temp中了select a.PartNO, a.Name,
    from tableName a, #temp b
    where a.ID = b.ID
    order by b.PKID大至思路是这样,我没调试脚本 :)
      

  6.   

    1, 在表中加主键 ID (本身应有一个主键吧?)2、
    create table #Temp
    (PKID int identity(1,1), 
    ID int )
    do while (exists( select * from tableName where ID not in (select ID from #temp)))
    begin
    insert #temp(ID)
    select min(id) id FROM tableName 
    where ID not in ( select ID from #temp)
    group by partionNO
    end
    --此时其顺序已经保存在表#temp中了select a.PartNO, a.Name,
    from tableName a, #temp b
    where a.ID = b.ID
    order by b.PKID大至思路是这样,我没调试脚本。
      

  7.   

    你要的显示结果是什么??ARTNO列:1,2,3,4...n吗??
    还是
    NAME列:aa,b,..