+ -
当前位置:首页 → 问答吧 → 7张表怎么同时比对其中的相同内容

7张表怎么同时比对其中的相同内容

时间:2011-12-26

来源:互联网

7张表怎么同时比对其中的相同内容 
select * from table1,table2
where table1.sfzh=table2.sfzh;
如果有7张表怎么写。

作者: wuqing9018   发布时间: 2011-12-26

table1,table2,table3,table4,table5,table6,table7,7张表中有相同的字段sfzh,同时比对7张表中的sfzh字段有公共的提取出来怎么写啊?

作者: wuqing9018   发布时间: 2011-12-26

SQL code

select * from table1 inner join table2 on table1.sfzh=table2.sfzh
                     inner join table3 on table1.sfzh=table3.sfzh
                     inner join table4 on table1.sfzh=table4.sfzh
                     inner join table5 on table1.sfzh=table5.sfzh
                     inner join table6 on table1.sfzh=table6.sfzh
                     inner join table7 on table1.sfzh=table7.sfzh

作者: pengxuan   发布时间: 2011-12-26