热线电话:13121318867

登录
2019-01-17 阅读量: 801
MySQL连接查询

内连接: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';

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

等值连接和内连接查询效果等效,用on建立连接关系,用where进行筛选

mysql 不支持 full join

0.1423
4
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子