SQLServer中的记录没有前后之分.如果有升序的主键。
select top 1 * from tablename order by 主键 desc

解决方案 »

  1.   

    declare @a int
    select @a=count(*) from yourtable
    set towcount @a
    select * from yourtable
      

  2.   

    declare @a int
    select @a=count(*) from yourtableselect identity(int,1,1) id,* into #temp from yourtable
    select * from #temp where id=@a
      

  3.   

    declare @id int
    select @id = max(主键) from table 
    select * from table where 主键 = @id
      

  4.   


    select identity(int,1,1) as id,* 
    into #temp
    from yourtableselect top 1 * from #temp 
    order by id descdrop table #temp
      

  5.   

    "BottomCount
    从集合底端开始返回指定数目的项,可以选择首先对集合排序。
    示例
    BottomCount(Geography.Cities.Members, 5, Sales)"
    这是我在SQL帮助里查到的,这怎么用啊
      

  6.   

    BottomCount
    是Analysis Services中MDX语法