练涛

MySQL学习笔记(19)——多表连接

多表连接

三表连接demo:
SELECT goods_id,goods_name,cate_name,brand_name,goods_price FROM tdb_goods AS g
INNER JOIN tdb_goods_cates AS c ON g.cate_id = c.cate_id
INNER JOIN tdb_goods_brands AS b ON g.brand_id = b.brand_id\G;

shwo databases
join on

可以说就是外键的一种逆向操作,外键将数据分开来存储,通过连接又将多张表联系在一起。

posted @ 2018-04-23 22:08  练涛  阅读(186)  评论(0编辑  收藏  举报