连表语句中 left join;
inner join;
right join;
使用on关联一个字段
例如:select * from a r
right join b uc
on r.course_id = uc.course_id
and r.users_course_apply = uc.users_course_apply
where uc.users_course_apply='444444'
只写一个on 第一步找连表中course_id=course_id 优先显示出来
第二找 where uc.users_course_apply='xx'
即使第二张表中没有值,也会重复显示,这个时候on后面接一个要判断的where 里的字段就可解决重复问题
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。