Results 1 to 1 of 1
  1. #1
    Join Date
    May 2005

    Unanswered: SELECT feilds in recursive table

    I have categoris table (tbl_categories)
    This table is recursive one , and have 3 feilds :

    CategoryID - (PM),
    ParentID - (FK),

    I also have products table (tbl_products) that hold CategoryID as FK.
    The Category table have only 2 level (category and sub category)

    How can i retrive the product feilds and the category feilds in one query for specific product?
    (i need both the category and the sub category feilds).

    i try this query but did not get result:

    SELECT tbl1.* ,tbl2.*, tbl3.* FROM ( tbl_products AS tbl1
    INNER JOIN tbl_categories AS tbl2 ON tbl1.CategoryID = tbl2.CategoryID )
    INNER JOIN tbl_categories as tbl3 ON tbl2.CategoryID = tbl3.ParentID
    WHERE productID=59

    never mind - i solve it
    Last edited by danh74; 10-02-06 at 18:27.

Posting Permissions

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