1、子查询关联
select t.*,
(select parent_name from table where id=t.parent_id)
from table t
where ...
2、左连接查询
select * from table t1 left join table t2 on t1.parent_id=t2.id where ...
1、子查询关联
select t.*,
(select parent_name from table where id=t.parent_id)
from table t
where ...
2、左连接查询
select * from table t1 left join table t2 on t1.parent_id=t2.id where ...