select max(字段名) from 表名称

解决方案 »

  1.   

    SELECT TOP 1 * FROM TableName 
    ORDER BY id, desc
      

  2.   

    select * from table where id=(select max(id) form table)
      

  3.   

    select * from table where id=(select max(id) from table)
      

  4.   

    SELECT TOP 1 * FROM xxxxx
    ORDER BY id desc Order by id desc 从大到小排序
    select top 1 *   返回最上一条(id最大)的整条记录
      

  5.   

    zxtyhy(地图鱼) 的方法:Select top 1 * from xxxxx order by id desc  也对。
      

  6.   

    select * from table where id=(select max(id) form table)
      

  7.   

    写两句sql应该也可以完成吧var
      iMaxID:integer;
      
      select max(id) from table1 ;
      iMaxID:=fields[0].asinteger;  select * from table1 where id = :maxid;
      parambyname('maxid').asinteger:=iMaxID;