Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2007
    Location
    Bangalore India
    Posts
    28

    Unanswered: find parent to which child

    Hi,
    I having table structure like
    ID IBelong ID
    1 0
    2 0
    3 1
    4 3
    5 2
    6 4


    I want to get values like parent record and their child and child's record also.

    can anyone tell me the query how to build.

    thanks in advance

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Some guy called Limeback seems pretty knowledgeable in this area
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    the article Categories and Subcategories contains query examples
    Last edited by healdem; 11-10-08 at 08:34.
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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