select  *  from  table1   where name  not in  (select  name   from table2)

解决方案 »

  1.   

    select A.name,A.age - B.age
    from table1 A,table2 B
    where A.name := B.name没试过,不知道行不行
      

  2.   

    to xuam() :
    不是匹配一个字段,是匹配两个表内的所有字段(两个表结构一样)
      

  3.   

    不是匹配的问题,只要排除两个表name一样的记录就可以了吧
      

  4.   

    select  *  from  table1 a  where not exists (select  *  from table2 b where a.name=b.name
    and a.age=b.age)
      

  5.   

    赞同lh1979()
    select  *  from  table1 a  where not exists (select  *  from table2 b where a.name=b.name
    and a.age=b.age)
      

  6.   

    select * from table1 where not exists (select * from table2);