e.g. If I have a table like below:-
create table Categories(CategoryId int primary key,
ParentCategoryId int foreign key references Categories(CategoryId))
e.g If I have the following data in my table:-
CategoryID ParentCategoryId
1 2
2 3
3 4
4 NULL
Result:
CategoryId ParentCategoryId
1 2
1 3
1 4
2 3
2 4
3 4
4 NULL
Thanks for any help!
Something like this:
Result: