Home > Backend Development > PHP Tutorial > Learn about the SQL INNER JOIN keyword

Learn about the SQL INNER JOIN keyword

jacklove
Release: 2023-03-25 15:34:01
Original
1758 people have browsed it


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

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

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!

Related labels:
source:php.cn
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