1. Join the left table as the main table, display all the data in the main table, and query the data in the right table according to the conditions. If the condition is met, it is displayed; if not, it is null.
2. It can be understood as ensuring that all data in the left table is displayed based on internal connections.
Syntax
select 字段 from a left [outer] join b on 条件
Example
Use left join to query the class table and student table
Here As is used to alias the table in order to write a simple
select * from students as s right join classes as c on s.cls_id = c.id;
The above is the detailed content of What is the syntax of mysql left outer join query. For more information, please follow other related articles on the PHP Chinese website!