I have a table for posts as (id, category_id, ...), then JOIN it with the category table as (category_id, category_name, parent, ...) ON category_id
Just do an additional join for the extra element, but have IT as a LEFT join as not all categories have a parent category and you don't want to exclude those.
select
P.ID,
P.Post_Title,
P.Category_ID,
C.Category_Name as FirstCat,
C.Parent,
COALESCE( C2.Category_Name, ' ' ) as ParentCategory
from
Posts P
JOIN Categories C
on P.Category_ID = C.Category_ID
LEFT JOIN Categories C2
on C.Parent = C2.Category_ID
where
AnyFiltering