自连接:自己的表和自己的表连接
核心:把一张表拆分成两张一样的表即可
-- 查询父子信息
SELECT categoryName AS '父栏目', categoryName AS '子栏目'
from category AS a, category AS b
where a.categoryid = b.pid
标签:category,栏目,categoryName,练习,pid,查询,联表,连接
来源: https://www.cnblogs.com/gss01/p/16652371.html