begin
Query.sql.clear;
Query.sql.add('select * from 表1');
Query.open;
while Query.eof<>true do
begin
combobox.idems.add(Query.fieldbyname('字段').astring);
Query1.next;
end;
end;

解决方案 »

  1.   

    select * from b1 where name not in (select name from b2)
    用上面的SQL就可以
      

  2.   

    然后在
    combobox.items.add(fieldbyname('name'));
      

  3.   

    Query1.SQL =Select 表1的字段1 as Field1 From Table1
    Union  //warning!! NOT union all
    Select 表2的字段1 as Field1 From Table2
    然后你再ComBoBox1.Items.Add(........希望你能明白
    呵呵
      

  4.   

    select distinct xm from table1 where  xm not in(  select rydm from table2),....可是提示错误的,如下:》capability not supported;《但是,我在sql server里可以啊,为什么呢?我用的是D5+sql7
      

  5.   

    select xm from table1 where  xm not in(  select rydm from table2),....用这个
      

  6.   

    TO renren6250(刀客) 
    谢谢:我的意思是,读表一的字段,但是,表一的字段和表二的字段的值有些是一样的,我只想读不一样的;也就是说,表一的值包含于表二,但是,我只想要表一的集合里减去表二的集合的值 
    我的目的是:select * from b1 where name not in (select name from b2) 可以正确执行;
      

  7.   

    TO jiaorg(jiaorg):"capability not supported;"是什么意思啊?,我的意思是,为什么会出现这种情况?
      

  8.   

    query.Close;                                                          query.SQL.clear;                                                 
       query.SQL.add('select fieldname from table1_name where           fieldname not in (select table2_name from table2_name)');          
       query.Open;                                                      
       combobox1.Clear ;                                                
       with query do                                                   
        begin                                                          
          first;                                                       
          while not (query.Eof ) do                                     
           begin                                                        
             combobox1.Items.Add(fieldbyname('fieldname').asstring);   
             Next;                                                     
           end;                                                         
        end;                                                             
    这下你再看去吧,细心一点好不好???