方式一:等值连接
select * from 表1,表2 where 表1.字段=表2.字段
此方式会产生笛卡儿积,生成的记录总数=表1的总数X表2的总数
会产生临时表
select * from student a,score b where a.no=b.no
运行原理首先是表1与表2进行笛卡儿积,然后生成临时表,最后根据where条件进行数据的过滤
方式二:内连接
不会产生笛卡儿积,不会产生临时表,性能高
select * from student a inner join score b on a.no=b.no
运行原理首先进行on后面条件的判断,然后再对表进行连接