**Sub Menu**
id|title
1 | Sub A
**Root_Sub**
id|root_id|sub_id
1 |9 |1
**Root Menu**
id|title
9 | Root X
I need to find out the id of a sub menu’s root menu.
To do this I use:
SELECT * FROM sub_menu LEFT JOIN root_sub ON sub_menu.id = root_sub.sub_id
This gives me ‘9’ as the ID.
But I also need to get the root menu’s title, ie getting the title ‘Root X’. How can I do this?
1 Answer