热线电话:13121318867

登录
2018-10-18 阅读量: 962
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
2
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子