在 MsSql中
select ID,identity(int,1,1) as order_id,Name,Total into #temp form table order by total desc
select * from #temp

解决方案 »

  1.   

    有点问题,应该是
    select identity(int,1,1) as Id,Name,Total into #temp form table order by total desc
    select * from #temp
      

  2.   

    建一个计算字段,在OnCalcFields事件中写
      Query1Field1.Value:=Query1.RecNo;
      

  3.   

    我想在SQL中直接用语句现实。
    我现在的table中没有ID字段。TO: forgot2000(忘记2000年) 
    select identity(int,1,1) as Id,Name,Total into #temp form table order by total desc
    能解释一下,这两个语句吗?
      

  4.   

    有点笔误,form-->from,desc--asc