内链接:内联接是用比较运算符比较要联接列的值的联接sql
内链接:join 或 inner joincode
sql 语句:select * from table1 join table2 on table1.id=table2.idget
等价(与下列执行效果相同)table
A:select a.*,b.* from table1 a,table2 b where a.id=b.idselect
B:select * from table1 cross join table2 where table1.id=table2.idsql语句
交叉链接(彻底):没有 WHERE 子句的交叉联接将产生联接所涉及的表的笛卡尔积。tab
第一个表的行数乘以第二个表的行数等于笛卡尔积结果集的大小。(table1和table2交叉链接产生3*3=9条记录)co
交叉链接:cross join (不带条件where...)join
sql语句:select * from table1 cross join table2oss
等价(与下列执行效果相同)
A:select * from table1,table2