本帖最后由 fanqie987 于 2011-04-07 16:20:05 编辑

解决方案 »

  1.   

    select a.* from a inner join (
    select * from b b1 where not exists(select 1 from b where b1.barcode=barcode and 
    date(`date`)='2011-04-07')) c on a.barcode=c.barcode
      

  2.   

    select * 
    from 表A
    where barcode not in (select barcode from 表B where date(`date`)='2011-04-07')
      

  3.   


    select * from a a1 join b b1 on a.id=b.id
    where not exists(select 1 from b x where x.id=b1.id and x.`date`>b1.`date`)