有两个数据表,他们之间没有建立关联,但是有一部分数据是完全相同的,怎么用 SQL语句把相同的查询出来!!!!!!!!!!!!!

解决方案 »

  1.   

    select * from table1,table2 where table1.field1=table2.field1 and table1.field2 = table2.field2...and table1.fieldn = table2.fieldn
      

  2.   

    select * from table1 where table1.field1 in (select table2.field1 from table2) and table1.field2 in (select table2.field2 from table2)....
      

  3.   

    select * from table1 where table1.field1 in (select table2.field1 from table2) and table1.field2 in (select table2.field2 from table2)....