Jump to content

Creating hierarchy text (R1 > R1' > R1'')


This topic is 5740 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hello,

I have a table of this format:

CATEGORY_NAME

CATEGORY_ID

PARENT_CATEGORY_ID

Is there an elegant way to have a text field in each record that will show the names of it's parents, grandparents, great-grandparents, etc., all the way to the root? For example:

"RootCat > SubCat1 > Subcat2 > Subcat3"

I tried some obvious (to me) methods with selfjoins, but I couldn't get it to display more than 2 or 3 levels deep. I found an example solution that did what I want along with many other things, but I think/hope it is overkill.

Any tips would be appreciated.

This topic is 5740 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.