SQL LEFT JOIN 关键字:会从左表(table_name1)那里返回所有的行,即使在右表(table_name2)中并没有匹配的行。
其语法为:
select column_name from table_name1 LEFT JOIN table_name2 on table_name1.column_name=table_name2.column_name
举例:
select Persons.LastName, Persons.FirstName, Orders.OrderNo from Persons LEFT JOIN Orders on Persons.Id_P=Orders.Id_P order by Persons.LastName