Home > Database > Mysql Tutorial > body text

Mysql inner connection query example analysis

王林
Release: 2023-05-26 23:33:21
forward
1340 people have browsed it

1. It is divided into implicit inner join query and explicit inner join query, which are distinguished by whether they contain the inner join keyword.

2. The data in the master table and the slave table can be queried if it meets the connection conditions. If it does not meet the connection conditions, it will not be queried.

Example

-- 2.1 隐式内连接方式
select *from t_category  c, t_product  p WHERE c.cid = p.cno;
 
-- 查询手机数码这个分类下的所有商品的信息以及分类信息
SELECT * FROM t_product tp INNER JOIN t_category tc ON tp.cno = tc.cid WHERE tc.cname = '手机数码';
 
-- 2.2 显示内连接方式  
SELECT * from t_category c INNER JOIN t_product p ON c.cid = p.cno
Copy after login

The above is the detailed content of Mysql inner connection query example analysis. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!