表A字段:So_no,Prd_no
表B字段:so_no,prd_no,A,B
想得到记录集:B表中所有在A表中存在的so_no,prd_no

解决方案 »

  1.   

    select * from B where exists(select 1 from A where a.So_no=b.So_no and a.Prd_no=b.Prd_no)
      

  2.   

    SELECT so_no,prd_no  from b where exists(select 1 from a where a.So_no = b.so_no and a.Prd_no = b.prd_no)
      

  3.   

    select * from b where exists(select 1 from a where So_no=b.So_no and Prd_no=b.Prd_no)
      

  4.   


    select * from b where exists(select 1 from a where So_no=b.So_no and Prd_no=b.Prd_no)
      

  5.   

    select * from b where exists(select 1 from a where So_no=b.So_no and Prd_no=b.Prd_no)