select 货号,价格 from 产品销售单 a
where not exists(select * from 产品销售单 where 货号=a.货号 and 销售时间>a.销售时间)

解决方案 »

  1.   

    參照 select a.b,a.c,b.d from 表1 a,表2 b  where a.b=b.b
    或者select a.b,a.c,b.d from 表1 a join 表2 b on a.b=b.b
      

  2.   

    试一下:
    select 货号,价格 from 销售单 a inner join 销售单明细 b
    where not exists(select 1 from from 销售单 c inner join 销售单明细 d where d.货号=b.货号 and c.销售时间>a.销售时间)
      

  3.   

    select 货号,价格 from 销售单 a inner join 销售单明细 b
    where not exists(select 1 from from 销售单 c inner join 销售单明细 d where d.货号=b.货号 and c.销售时间>a.销售时间 and a.销售单号=c.销售单号)