select  编号 from 表1 where 编号 not in( select 编号 from 表2 )

解决方案 »

  1.   

    mysql> select table1.* from table1
               LEFT JOIN table2 ON table1.id=table2.id
               where table2.id is NULL;这个例子找出在table1中所有的行,其id值在table2中不存在(即,所有table1中的在table2中没有对应行的行)。当然这假定table2.id被声明为NOT NULL。
      

  2.   

    mysql> select id from tt3 where not exists (select id from tt2 where tt2.id=tt3.
    id);