oracle的全连接查询可以直接用full on,但是在mysql中没有full join,mysql使用union实现全连接. oracle的全连接 select * from a full join b on a.id = b.id; mysql的全连接 select * from a left join b on a.id = b.id union select * from a right join b on a.id = b.id; 参考: https://blog.csdn.net/…
左外连接的概念性不说了,这次就说一说两个表之间的查询步骤是怎么样的? 例如 SELECT ut.id,ut.name,ut.age, ut.sex,ut.status,st.score,st.subject_name FROM b_score_test st left join b_user_test ut on st.user_id=ut.id 由于st 在left join 左边,所以以它为参考,遍历ut每一行和st比较,就相当于for(ut...){for(st...)} ,右连接…