zhiqingstudy

Be a young person with knowledge and content

1. Introduction to Connection Query

Join query can be used to query multiple data tables. When the queried field data comes from different tables, join query can be used to complete.

The connection query can be divided into:

① , Internal connection query

② , Left Join Query

③ , Right Join Query

④ , Self Connect Query

2. Inner join query

Query the matching common records in two tables

Effect picture of internal connection query:

Query method of connection in sql database, and what is the syntax of connection query in sql database

Syntax format of inner join query:

SELECT 字段 FROM 表1 INNER JOIN 表2 ON 表1,字段1 = 表2,字段2

explain:

① INNER JOIN is the inner join query keyword

② And ON are connection query conditions

If Field 1 in Table 1 is equal to Field 2 in Table 2, the results can be queried.

Example: Query student table and class table using inner join

SELECT * FROM students INNER JOIN class on students.class=class.className;

Example: Query the class of the student

SELECT students.name,class.className FROM students INNER JOIN class on students.class=class.className;

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号