select b.*
from a,b
where a.proid = b.proid

解决方案 »

  1.   


    select b.*
    from a,b
    where a.proid = b.proid AND a.proid='1001'
    可是会出现6条相同的记录出来。
      

  2.   


    select b.*
    from a,b
    where a.proid = b.proid AND a.proid='1001'
    可是会出现6条相同的记录出来。对了,表B中同一个proid的记录有好多条。
      

  3.   


    select b.*
    from a,b
    where a.proid = b.proid AND a.proid='1001'
    可是会出现6条相同的记录出来。对了,表B中同一个proid的记录有好多条。试试这个:
    select b.*
    from b
    where exists (select 1 from a where a.proid = b.proid AND a.proid='1001')
      

  4.   


    select b.*
    from a,b
    where a.proid = b.proid AND a.proid='1001'
    可是会出现6条相同的记录出来。对了,表B中同一个proid的记录有好多条。试试这个:
    select b.*
    from b
    where exists (select 1 from a where a.proid = b.proid AND a.proid='1001')
    您好,我加了个distinct 上去,不懂会不会影响结果?测试了几条数据暂时没问题。
    select  distinct b.*
    from a,b
    where a.proid = b.proid AND a.proid='1001'
      

  5.   


    select b.*
    from a,b
    where a.proid = b.proid AND a.proid='1001'
    可是会出现6条相同的记录出来。对了,表B中同一个proid的记录有好多条。试试这个:
    select b.*
    from b
    where exists (select 1 from a where a.proid = b.proid AND a.proid='1001')
    您好,我加了个distinct 上去,不懂会不会影响结果?测试了几条数据暂时没问题。
    select  distinct b.*
    from a,b
    where a.proid = b.proid AND a.proid='1001'哦,可以的,不过这样性能比较差,比较好的还是上面我写的exists的写法
      

  6.   


    select b.*
    from a,b
    where a.proid = b.proid AND a.proid='1001'
    可是会出现6条相同的记录出来。对了,表B中同一个proid的记录有好多条。试试这个:
    select b.*
    from b
    where exists (select 1 from a where a.proid = b.proid AND a.proid='1001')
    您好,我加了个distinct 上去,不懂会不会影响结果?测试了几条数据暂时没问题。
    select  distinct b.*
    from a,b
    where a.proid = b.proid AND a.proid='1001'哦,可以的,不过这样性能比较差,比较好的还是上面我写的exists的写法
    谢谢啊!