MySQL(3)-Joins
Published in
1 min readMay 13, 2016
- left join = A
- select <select_list> from tableA A left join tableB B on A.key=B.key
- inner join = (common part between A and B)
- select <select_list> from tableA A inner join tableB B on A.key=B.key
- right join = B
- select <select_list> from tableA A right join tableB B on A.key=B.key
- A — (common part between A and B)
- select <select_list> from tableA A left join tableB B on A.key=B.key
where B.key is NULL - B — (common part between A and B)
- select <select_list> from tableA A right join tableB B on A.key=B.key
where A.key is NULL - A + B
- select <select_list> from tableA A full outer join tableB B on
A.key=B.key - A + B — (common part between A and B)
- select <select_list> from tableA A full outer join tableB B on
A.key=B.key where A.key is NULL or B.key is NULL