注意,该行没有任何用来标识的列,所以不能用MAX/MIN

解决方案 »

  1.   

    select top 1 *
    from 表
    order by 排序列 desc
      

  2.   

    declare @t table([name] varchar(10))insert into @t select 'aa'
    insert into @t select 'bb'
    insert into @t select 'cc'
    insert into @t select 'dd'
    insert into @t select 'ee'
    insert into @t select 'ff'
    insert into @t select 'gg'
    insert into @t select 'hh'select [id]=identity(int,1,1),* into # from @t
    select top 1 * from # order by [id] desc
    drop table #
      

  3.   

    楼上的,这是排序啊。
    假如:field1 field2 field3
    sda     qw      sad
    sasa    sqw     sad
    sdsa    asqw    sad
    ssda     qw      sdd这样就不行了
      

  4.   

    xeqtr1982(ShaKa) 的办法可以的,select ....into....本身就有复制表功能, 
    [id]=identity(int,1,1),就是新增一个唯一标志列,有了它就可以排序拉,就可以得到最后一条记录了
      

  5.   

    哦~不好意思,刚才没有看到identity