编号最大的就是最后一条,可以通过对[编号]进行降序排序后只取一条。
其中的《where 条件》可根据实际需要而定,如不需要可以不写。select top 1 * from [表名] 《where 条件》order by [编号] desc

解决方案 »

  1.   

    可在sybase中说该语句错误,无法执行,怎么回事?快告诉我,谢谢
      

  2.   

    因为sybase不支持top的语法, top语法只有在Access及SQL Server中支持---
    很高兴能帮到你!谢谢!
    *******************************
    您知道吗?我们非常需要您的帮助
    *******************************
    网站:http://www.yesue.com/
          IT 电 脑 顾 问 专 家 论 坛
      

  3.   

    declare @MaxID int;
    select @MaxID = max(tid) from test
    select * from test where tid=@MaxID
    用3行如何?
      

  4.   

    这样行不行:select * from test where tid=(select max(tid) from test)