有三个表A、B、C
A表中的数据是1、2、3、4、5、6、7、8、9、10
B表中的数据是9、3、1
C表中的数据是5、6
如何取得A-(B+C)的数据?

解决方案 »

  1.   

    读到Tsringlist再进行比较?这样比较麻烦啊
      

  2.   

    select Field1 from A where Field1 not in (select Field1 from B union select Field1 from C)
      

  3.   

    有问题? 
    with ADOQuery1 do
       begin
         Close;
         SQL.Clear;
         sql.Add('select 机号 from klib where 机号 not in (select 机号 from jf union select 机号 from pc)');
         open;
         First;
         while not Eof do
          begin
            ListBox1.Items.Add(FieldValues['机号']);
            Next;
          end;
          Close;
       end;
      

  4.   

    出现“字查询中不允许此操作”
    数据库是Access
      

  5.   

    select F1 from A where F1 not in (select f1 from b) and F1 not in (select f1 from c)