例如:
no      date1         num
01    2006/04/22      10
01    2006/04/22      15
01    2006/04/22      200
02    2006/03/15      10
02    2006/04/13      20
03    2006/04/01      22
03    2006/04/12      12
03    2006/04/12      18
......
我想得到结果:
no    date1           num
01    2006/04/22      10
02    2006/04/13      20
03    2006/04/12      18
....
最新的num!我该怎么取啊!

解决方案 »

  1.   

    num最新这句没懂,都是同样的时间
      

  2.   

    就是一样时间的取第一条,不同时间的取最新时间的num
      

  3.   

    select distinct date1 from 表名
      

  4.   

    Select Top 1 * from TableName
    where data1 in (select data1 from TableName group by data1)
      

  5.   

    这样取的不是最新的,这样取的会出现一个no有很多个num
      

  6.   

    select *
    from tb a
    where num =
    (select top 1 num 
    from tb
    where tb.no =a.no
    )
      

  7.   

    ?? 不是直接去 SQL 
    select distinct date1  就可以了么>??