Home  >  Article  >  Database  >  How to write an inner connection in mysql

How to write an inner connection in mysql

little bottle
little bottleOriginal
2019-05-29 16:35:014994browse

Connections are divided into: inner joins, outer joins, and cross joins. Today we will learn how to use MySQL to establish an inner connection.

How to write an inner connection in mysql

#Inner join definition: Only the rows in the two tables that meet the join conditions are combined as the result set.

Keywords: INNER JOIN

select * from employees e inner join department d 
on e.employee_id = d.department_id  where e.employee_id = "1";

is equivalent to

select * from employees e,department d 
where e.employee_id = d.department_id and e.employee_id = "1";

The above is the detailed content of How to write an inner connection in mysql. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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