#inner join equivalent connection/INNER JOIN
Mysql> Select * frominfo;+------+-------------+----------+|Name|Phone|Address|+------+-------------+----------+|Zhao| 13199999999 |Beijing||Qian| 1328888888 |Harbin||Sun| 13366666666 |Shanghai|+------+-------------+----------+3Rowsinch Set(0.00Sec
Mysql> Select * fromscore;+----+------+-------+------------+|Id|Name|Score|Evaluation|+----+------+-------+------------+| 1 |Zhao| 98.00 | Ten || 2 |Qian| 90.30 | Ten || 3 |Sun| 70.00 | Ten || 4 |Li| 80.50 | Ten |+----+------+-------+------------+4Rowsinch Set(0.00Sec
#inner join--Connect Some of the fields in two tables (filter columns) to form a table by the same name value (filter rows)
Mysql> SelectScore.id,score.name,info.phone fromScoreInner JoinInfo onScore.name=Info.name;+----+------+-------------+|Id|Name|Phone|+----+------+-------------+| 1 |Zhao| 13199999999 || 2 |Qian| 1328888888 || 3 |Sun| 13366666666 |+----+------+-------------+3Rowsinch Set(0.00Sec
#left join--reads all the values of the fields on the left table score, joins the fields in the two tables by the same name value to form the table (the table on the right does not have the corresponding record filled null)
Mysql> SelectScore.id,score.name,info.phone fromScore Left JoinInfo onScore.name=Info.name;+----+------+-------------+|Id|Name|Phone|+----+------+-------------+| 1 |Zhao| 13199999999 || 2 |Qian| 1328888888 || 3 |Sun| 13366666666 || 4 |Li| NULL |+----+------+-------------+4Rowsinch Set(0.00Sec
#类似的有right Join
Mysql> SelectScore.id,score.name,info.phone fromScore Right JoinInfo onScore.name=Info.name;+------+------+-------------+|Id|Name|Phone|+------+------+-------------+| 1 |Zhao| 13199999999 || 2 |Qian| 1328888888 || 3 |Sun| 13366666666 |+------+------+-------------+3Rowsinch Set(0.00Sec
Cheng Plan--mysql Connection table