--INNER JOIN----SelectGoods_id,goods_name,cate_name fromTdb_goodsInner JoinTdb_goods_cates ontdb_goods.cate_id=tdb_goods_cates.cate_id\g; The inner join returns both tables .SelectGoods_id,goods_name,brand_name fromTdb_goodsInner JoinTdb_brand ontdb_goods.brand_id=tdb_brand.brand_id;--left connection--SelectGoods_id,goods_name,cate_name fromTdb_goods Left JoinTdb_goods_cates ontdb_goods.cate_id=Tdb_goods_cates.cate_id\g The LEFT join returns the first (that is, the left) table .SelectGoods_id,goods_name,brand_name fromTdb_goods Left JoinTdb_brand ontdb_goods.brand_id=tdb_brand.brand_id; Values that are not referenced by the right table are replaced with null--Right Connection--SelectGoods_id,goods_name,cate_name fromTdb_goods Right JoinTdb_goods_cates ontdb_goods.cate_id=tdb_goods_cates.cate_id\g; The right Join returns a second (that is, the right) table .SelectGoods_id,goods_name,brand_name fromTdb_goods Right JoinTdb_brand ontdb_goods.brand_id=tdb_brand.brand_id; Values that are not referenced by the left table are replaced by null instead of the control:SelectGoods_id,goods_name,brand_name fromTdb_brand Left JoinTdb_goods ontdb_goods.brand_id=tdb_brand.brand_id; Summary: The INNER join will only show the columns in both tables, left connection reference left table, the right table has no value to set NULL, right connection reference right table, left table no value is set NULL, the table name is the same as the connection between the two tables.
MySQL inner join, leftist, right join