子查询与连接
连接
语法结构
<table_name> <连接语句> <tb_name2>
on <条件表达式>
内连接
显示左表和又表都符合条件的语句
语句:inner join
<table_name> inner join <tb_name2>` on <条件表达式>
外连接
左外连接
显示左表的全部记录并显示和右表符合条件的数据
语句:left join
<table_name> left join <tb_name2>
on <条件表达式>`
右外连接
显示右表的全部记录并显示和左表符合条件的数据
语句:right join
<table_name> right join <tb_name2>
on <条件表达式>`