hierarchical data headache

S

sklett

** repost with more info **

I am not very good at SQL queries. I just can't get it. With that said, I
need some help really bad figuring out a way to get some data to present
hierarchically.

Here is the sitch'
I want to display product FAQs like this:
PRODUCT
FAQ CATEGORY
FAQ ITEM(s)

So, for each product there will be multiple categories and for each category
there will be multiple FAQ items.


The data is stored in tables like this:

[ Products_Main ]
ProdId
ProdName
.. other data

[ Prod_Faqs ] (many-to-many)
ProdId
FaqId

[ Faqs_Main ]
FaqId
CatId
Question
... other faq data

[ Faq_Categories ]
CatId
CatName


I can't find a way to get this data in a form that I can use.
I have a sproc that is getting 2 tables, product data in the first and the
second table is ALL of the faqs
then I have a relation that will allow me to get the FAQs for the correct
product, but getting the categories is another story.

I suspect that I should use DataRelations to do this, but am not sure how to
accomplish it. If you know how to do this, could you please share some tips
or even code samples?
 
S

sklett

I just threw a ton of INNER JOIN at it, then pre-processed it into a set of
classes.. everything works now ;)
If any one wants a more detailed explanation, I could write it up, but I
suspect this is not a big deal.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top