select 编号,MAX(时间) from table where 编号='aaa' group by 编号

解决方案 »

  1.   

    Select Max(Date1) From TableTable1.Filter:='ID:='''myid''' and date1='+DateToStr(Query1.Fields[0].AsDateTime);
      

  2.   

    先用Select Max(Date) From Table来取得最新的时间值,再用Tabel1的Filter来过滤。
      

  3.   

    select top 1 from table where bh=:mbh and time<=now
      

  4.   

    select top 1 编号,时间 from table where 编号='aaa' order by 时间 desc
    当然,使用li_zhifu(东北人)的第二个方法也行
      

  5.   

    我也是: Select 编号,MAX(时间) From Table Where 编号='***' Group By 编号 
      

  6.   

    Select 编号,MAX(时间) From Table Where 编号='***'
      

  7.   

    select * 
    from  table
    where fieldid=constid and fieldtime=
    (
     select max(fieldtime)
     from table
    )