zhiqingstudy

Be a young person with knowledge and content

Right Join Query

Query the left table data based on the right table and criteria. If the left table data of the criteria query does not exist, fill it with null values.

Effect picture of right link query:

How to write sql right join? What is the usage of sql right join

Right join query syntax format:

SELECT 字段 FROM 表1 RIGHT JOIN 表2 on 表1.字段1 =表2.字段2 ;

explain:

① Right JOIN is the right join query keyword;

② And on are connection query criteria;

③ Table 1 is the left table;

④ Table 2 is the right table.

Example: Use the right link to query the student table and class table

SELECT * FROM `students` RIGHT JOIN `class` on class.`className` =students.`class` ;

Execution result:

How to write sql right join? What is the usage of sql right join

comment
head sculpture
Code:
Related

Why you shouldn't stay at a job for more than 2 years?

3 harsh facts long-distance relationships

how to keep your girlfriend interested in a long-distance relationship




Unless otherwise specified, all content on this website is original. If the reprinted content infringes on your rights, please contact the administrator to delete it
Contact Email:2380712278@qq.com

Filing number:皖ICP备19012824号