Home > Database > Mysql Tutorial > What is the syntax of mysql left outer join query

What is the syntax of mysql left outer join query

王林
Release: 2023-05-27 09:40:06
forward
914 people have browsed it

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 条件
Copy after login

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;
Copy after login

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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template