select* form A,B where A.id=B.id
select*from A innerjoin B on A.id=B.id
2、左外连接查询
select*from A left[outer]join B
on A.id = B.id
3、右外连接查询
select*from A right[outer]join B
on A.id=B.id
4、全外连接
全外连接full outer join (mysql不支持)
union 可以连接两个查询语句并去重
select * from A left outer join B on
A.id = B.id
union
select * from A right outer join B on
A.id = B.id
5、左外连接结果去掉交集
select * from A left [outer] join B on
A.id=B.id where B.id is null
6、右外连接去掉交集
select* form A rightjoin B
on A.id = B.id where A.id isnull
7、AB全集去掉AB交集
select*from A leftouterjoin B on A.id = B.id
where B.id isnullunionselect*from A rightouterjoin B on A.id = B.id
wherer A.id isnull
mysql内连接外连接(图解)1、内连接查询select * form A,B where A.id=B.idselect * from A innner join B on A.id=B.id2、左外连接查询select * from A left [outer] join B on A.id = B.id3、右外连接查询select * from A right [outer] join Bon A.id=B.id4、全外连接[外链图片转存失败,源站可能有防盗链机制,建