表1 t_one (数据4条) 表2 t_two (数据多条)
left join on 左连接
以左边表为准,将右表与其条件相符的数据展示出来;(左表数据全部显示,右表中条件不符合的,不显示)
select * from t_one left join t_two on t_one.id =t_two.id
right join on 右连接
以右边表为准,将左表与其条件相符的数据展示出来;(右表数据全部显示,左表中条件不符合的,不显示)
select * from t_one right join t_two on t_one.id =t_two.id
join on 内连接
只显示它们条件符合的数据
select * from t_one join t_two on t_one.id =t_two.id