select 产品号,MAX(终止日期) From Tabel group by 产品号

解决方案 »

  1.   

    select a.* from table a inner join
    (select 产品号 ,max( 终止日期) 终止日期  from table ) b
    on a.产品号=产品号 and a.终止日期=b.终止日期
      

  2.   

    select a.* from table a inner join
    (select 产品号 ,max( 终止日期) 终止日期  from table group by  产品号) b
    on a.产品号=产品号 and a.终止日期=b.终止日期
      

  3.   

    先把数据库的日期转化为integer型,再用MAX函数
      

  4.   

    select distinct 产品号,max(终止日期)from tabel
      

  5.   


    select a.* from Tabel A,(select 产品号,MAX(终止日期) 终止日期 From Tabel group by 产品号) b where a.产品号=b.产品号 and a.终止日期=b.终止日期orselect * from table1 A where not exists(select 1 from table1 where 产品号=A.产品号 and 终止日期>A.终止日期)