select table1.a from table1 where table1.b in (select table2.b from table2)

解决方案 »

  1.   

    select distinct table1.a from table1 where table1.b in (select table2.b from table2)
      

  2.   

    select distinct A as [table1.A] into results from (
    select * from table1 inner join table2 on table1.B=table2.B
    group by A)
      

  3.   

    bpfrom(天籁之音)的办法就行啊,只要Table2不是很大,这个办法很有效的
      

  4.   

    select e.a from table1 e,table2 f where e.b=f.c 
    group by e.a 
    having count(distinct e.b)>=(select count(*) from table2)
      

  5.   

    (天籁之音)的办法没有比较和TABLE2中所有的值,象B也符合要求
      

  6.   

    不是wy t yf而是wy l yf!
    只是把上面兄弟的方法总结了一下加了个条件而已!
      

  7.   

    to:: wylyf & : xiaofei104
    用李飞刀wylyf 的办法的话,b也满足条件,是你要的吗?
      

  8.   

    to:OpenVMS(半知半解) 我试过不会