if at first you don't succeed...

Results 1 to 2 of 2

Thread: if at first you don't succeed...

  1. #1
    Join Date
    Dec 1969

    Default if at first you don't succeed...

    Guys,<BR><BR>I posted this message 36 hours, but with no luck in terms of useful replies. So I am going to try again (sorry)...here goes....<BR><BR>I feel bad asking for help, but I must stress that I have tried to do this myself before posting here. <BR><BR>I have a tale called categories_sub_categories that has two fields, category_ID and sub_category_ID. This table stores a tree hierarchy with the category_ID being a parent node and the sub_category_ID being a child category. Any child may only have one parent, but any parent may have several children. <BR><BR>I have another table called Report_Category that has two fields, report_ID and category_ID. This table shows what reports are contained in each category. <BR><BR>What I want to do is write a stored procedure that takes in a category_ID and gives back a list of all the reports in both this category and in all its children. <BR><BR>I have tried writing a stored procedures to accomplish this but failed miserably. I would post my code if I thought it would be of any help, but I don&#039;t think it will be. <BR><BR>Any help would be much appreciated..... <BR><BR>Cheers, <BR>Ross <BR>

  2. #2
    Join Date
    Dec 1969

    Default Quit.

    SELECT *<BR>FROM table1, table2<BR>WHERE table1.category_id = table2.category_id<BR><BR><BR>Assuming that&#039;s how you have it setup, I think.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts