Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2003
    Posts
    19

    Unanswered: Help with multi-select query

    Hello,
    I'm trying to create a query that will return the group_id requested and the inherited_group_id as long as it's not 0 (zero).
    For example if I search for group_id = 3 I would get back 3 and 2. Now if I searched for group_id 5 I would get back 5,3,2

    I hope this makes sense,

    Thanks,
    Charlie

    my_table
    rid,group_id,parent_id,inherit_parent_id
    1,2,0,0
    3,3,2,2
    5,5,3,3
    7,7,0,0

  2. #2
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    take a look at recursive SQL
    Dave

Posting Permissions

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