ALTER proc upSoftWare  
as   
set rowcount 10 
select name,tim,counter 
from (select top 15 * from down order by tim desc) A 
order by tim

解决方案 »

  1.   

    ALTER proc upSoftWare  
    as   --表里没有自增字段,才可以如下
    select identity(int,1,1) FID,* into #temp from tablename
    go
    select * from #temp where FID between 5 and 15
    go
    drop table #temp
      

  2.   

    同意sdhdy(大江东去...) 但是得改进。
    只取前15条。
    以下同。
      

  3.   

    ALTER proc upSoftWare  
    as   
    if object_id('tempdb..#tem') is not null
    drop table #tem
    select identity(int,1,1) ids,name,tim,counter  into #tem 
    from down 
    order by tim 
    select name,tim,counter
    from #tem
    where ids between 5 and 14
      

  4.   

    ALTER proc upSoftWare中的ALTER是什么意思?不是都用CREATE的吗?
      

  5.   

    ALTER proc upSoftWare  
    as   
    select top 10 name,tim,counter 
    from (select top 15 * from down order by tim desc) A 
    order by tim
      

  6.   

    ALTER proc upSoftWare  
    as   
    select top 10 name,tim,counter from down where tim not in (select top 5 tim from down) order by tim 
      

  7.   

    这里的热心朋友太多了,我要慢慢看看,谢谢大家
    to: yujohny(踏网无痕) 
    为什么有的人喜欢用CREATE,而有的人喜欢用ALTER