select id= identity(int,1,1),*  into  #hhh from pub_code
select * from #hhh order by id desc
drop table #hhh

解决方案 »

  1.   

    如果有ID
    SELECT MAX(ID)FROM TABLE
    如果有时间记录date
    select max(date) from table
      

  2.   

    有id
    select top 1 * from table1 order by id desc
    无id,临时表:
    select id=identity(int,1,1),* into temp from table1
    select top 1 * from temp order by id desc
    drop table temp
      

  3.   

    select top 1 * from table order by id desc
      

  4.   

    leeboyan(宝宝) ( )
    临时表命名是不是还有什么规矩呢,
    我取aa的时刻就不对了 !
      

  5.   

    select top 1 * from table order by id desc
      

  6.   

    sorry
    我刚才建立了一个视图的名字就aa嘻嘻
    非常抱歉