[MySQL相关]内联,左外联,右外联,全连接,交叉连接 的区别

2020-04-10T00:56:03

典型多对多联表查询:

select man_to_women.nid,man.name as mname, women.name as wname from man_to_women  
left join man on man_to_women.man_id = man.nid
left join women on man_to_women.women_id = women.nid
where man.name = 'alex'

左联:显示左边表的所有数据,只显示右边表与左边表有关联的数据

当前页面是本站的「Baidu MIP」版。发表评论请点击:完整版 »