select 存货编码,存货名称,min(订单日期)as 订单日期 from t group by 存货名称

解决方案 »

  1.   

    select
        存货编码,
        存货名称,
        订单日期 as 最早订单日期
    from
        数据表 a
    where
        not exists(select 1 from 数据表 where 存货编码=a.存货编码 and 订单日期<a.订单日期)
      

  2.   

    select min(存货编码)as 存货编码,存货名称,min(订单日期)as 最早订单日期 from t group by 存货名称
      

  3.   

    汗ing,又一次的舍本逐末了......
      

  4.   

    select 存货编码,存货名称,min(订单日期)as 订单日期 from t group by 存货名称,存货编码