With a table like this:
I want to get the following result:Code:id| name | parent ==================== 1 | parent1 | null 2 | parent2 | null 3 | child1 | 1 4 | child2 | 1 5 | child3 | 2
parent1
- child1
- child2
parent2
- child3
I'm currently doing a LEFT JOIN on parent = id. Is there a better way to achieve what I want?
Sean![]()







Bookmarks