Home >Database >Mysql Tutorial >Mysql inner connection query example analysis

Mysql inner connection query example analysis

王林
王林forward
2023-05-26 23:33:211360browse

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

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!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete