Mysql 子类查询所有父类
摘要:
SELECT area_.id, area_.name FROM ( SELECT @r AS _id, (SELECT @r := parentid FROM `hk_area` WHERE id = _id) AS parentid, @l := @l + 1 AS lvl FROM (SELECT @r := 2106, @l := 0) vars, `hk_area` h... 阅读全文
posted @ 2017-05-22 21:49 坐看云起的从容 阅读(460) 评论(0) 推荐(0) 编辑