291294878

2018-10-18   阅读量: 809

数据分析师 Mysql

mysql联结方式?

扫码加入数据分析学习群

多表查询中:

>>where的等值联结和内联结一样;子查询也可以等效;on建立联结关系,where筛选

内联结:select * from A inner join B on A.Key = B.Key;

左联结:select * from A left join B on A.Key = B.Key;

右联结:select * from A right join B on A.Key = B.Key;

等值联结:select A_name,B_name,B_mobile from A, B where A.A_id = B.B_id

自联结:select p1.user_id, p1.user_name from usertable as p1, usertable as p2 where p1.user_id = p2.user_id and p2.user_id = '10086';

叉联结:卡迪尔积,没有建立联结关系的表,行数为两表行数相乘

mysql 不支持 full join

0.0000 0 2 关注作者 收藏

评论(0)


暂无数据

推荐课程