当前位置:Gxlcms > 数据库问题 > mysql左外连接

mysql左外连接

时间:2021-07-01 10:21:17 帮助过:19人阅读

左外连接的概念性不说了,这次就说一说两个表之间的查询步骤是怎么样的?

例如 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...)}  ,右连接的话,就以右边为参考,一样道理

 

mysql左外连接

标签:name   user   blog   stat   join   遍历   rom   右连接   post   

人气教程排行