select * from table1 a where date=
(select max(date) from table1 where name=a.name)
and time=(select max(time) from table1 where name=a.name and date=a.date)

解决方案 »

  1.   

    select * from table a where not exists(select * from table where name=a.name and date>a.date and time>a.time)
      

  2.   

    ---怎么同一个人,age还有大有小。select B.* from (select name,max(age) as age,max([date]) as [date] ,max([time]) as [time] from tb 
    group by name) A inner join tb B on A.name=B.name and [A.date]=[B.date] and A.time=B.time
      

  3.   

    select a.* from test a,
        (select name,max(date+time) as dt from test group by name) b
    where a.name=b.name and a.date+a.time = b.dt
      

  4.   

    我是这样写的不知道是错在那里
    slect name,age,max(date),max(time),summary
    from table
    group by name,age,date,time,summary
      

  5.   

    不知为什么我运行xiaomeixiang(Little Sheep)的句子,返回的结果有很多记录没有了,我在运行一下其他的看看
      

  6.   

    to: 29673079(薛圆) 
    你应该看看group by 的用法。
      

  7.   

    slect name,max(age),max(date),max(time),summary
    from table
    group by name,summary