复习
SQL join :用于根据两个或多个表中的列之间的关系,从这些表中查询数据
eg:
SELECT Persons.LastName, Persons.FirstName, Orders.OrderNo FROM Persons, Orders WHERE Persons.Id_P = Orders.Id_P
SELECT Persons.LastName, Persons.FirstName, Orders.OrderNo FROM Persons INNER JOIN Orders ON Persons.Id_P = Orders.Id_P ORDER BY Persons.LastName
外连接
LEFT JOIN 关键字语法
SELECT column_name(s) FROM table_name1 LEFT JOIN table_name2 ON table_name1.column_name=table_name2.column_name
SQL FULL JOIN 关键字
只要其中某个表存在匹配,FULL JOIN 关键字就会返回行。
SELECT column_name(s) FROM table_name1 FULL JOIN table_name2 ON table_name1.column_name=table_name2.column_name
数据库系统原理(二) - SunArmy - 博客园 (cnblogs.com)
标签:JOIN,name,记录,column,Persons,sql,table,自学,Orders From: https://www.cnblogs.com/redemption011/p/16825540.html