あなたは
のようなものが欲しいselect a.id as child_id, a.name as child_name,
b.id as parent_id, a.name as parent_name
from forum_categories a
inner join forum_categories b
on a.parent_id = b.id
既知のIDに制限するには、追加
where a.id = knownid
あなたは
のようなものが欲しいselect a.id as child_id, a.name as child_name,
b.id as parent_id, a.name as parent_name
from forum_categories a
inner join forum_categories b
on a.parent_id = b.id
既知のIDに制限するには、追加
where a.id = knownid