Home > Article > Backend Development > Learn about the SQL INNER JOIN keyword
SQL INNER JOIN keyword is very important in php, so this article will introduce its related knowledge in detail.
The INNER JOIN keyword returns rows when there is at least one match in the table.
INNER JOIN keyword syntax
SELECT column_name(s) FROM table_name1 INNER JOIN table_name2 ON table_name1.column_name=table_name2.column_name
Note: INNER JOIN is the same as JOIN
Inner connection(INNER JOIN )Example
Now, we want to list everyone's orders.
You can use the following SELECT statement:
SELECT Persons.LastName, Persons.FirstName, Orders.OrderNo FROM Persons INNER JOIN Orders ON Persons.Id_P=Orders.Id_P ORDER BY Persons.LastName
This article provides a relevant introduction to the join keyword. For more learning materials, please pay attention to the php Chinese website.
Related recommendations:
Related knowledge about SQL JOIN
Explanation of SQL Alias (alias) in php
How to use the SQL BETWEEN operator
The above is the detailed content of Learn about the SQL INNER JOIN keyword. For more information, please follow other related articles on the PHP Chinese website!