Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 All Child nodes with no children

Author  Topic 

ts46235
Starting Member

5 Posts

Posted - 2002-09-20 : 10:42:52
Hello all, I'm wondering if anyone has the answer to my question. I have a parent/child relationship, and would like to find all the child nodes that do not have any more children. I have categories that can have sub categories. I want to put products only in the bottom most categories:
Cameras-->Digital Cameras-->Cannon Coolpix 5700.

NOT: Cameras-->Digital Cameras/High Resolution-->Samsung MultiFocus
\Cannon Coolpix 5700

Sub categories cannot be siblings with products, so when I am entering a new product in the database, I want to populate a drop down box with only legitimate categories that have no subcategories.

I haven't seen any posting on the web relating to my problem. If anyone has any ideas, I would love to hear them.

I appreciate any help anyone can give.

ts46235
Starting Member

5 Posts

Posted - 2002-09-20 : 10:48:42
The format didn't come out as I had hoped:

The "\Cannon Coolpix 5700" in the 2nd illustration is supposed to be a product of Digital Cameras, and depicted as a sibling of "High Resolution" - this of course is the scenario I am trying to avoid

Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-09-20 : 10:56:49
Try this:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=19781

If that doesn't work, you'll have to provide more detail on your table structures and SQL queries being used. Also, are you using SQL Server or another product?

Go to Top of Page

ts46235
Starting Member

5 Posts

Posted - 2002-09-20 : 11:11:19
Wow, that is exactly what I wanted, It worked perfectly. This forum is an excellent resource for developers.

Thanks a bunch robvolk!

Go to Top of Page
   

- Advertisement -