I have a table like this:
Name CategoryId ParentCategoryId
Footwear 93 0
Men Shoes 6 93
Female Shoes 7 93
Mobile 2 0
Smartphone 4 2
I need output like:
Name Categories
Footwear 93,0
Men Shoes 6,93,0
Female Shoes 7,93,0
Mobile 2,0
Smartphone 4,2,0
Basically, I need to recursively get the category ids and make them into a comma delimited string. I am getting into SQL
after 3 years now and I have no idea how to get this result. I have tried solutions from other SO questions but still no luck.