Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2004
    Posts
    2

    Unanswered: help with recursive quary

    I would try to explain my problem using and example.


    table 1
    -------

    order# Action# data startDate EndDate
    ----- ----- -------- -------- --------
    XXXX XXXX XXXXXX XXXXX XXxXX



    Table 2
    -------

    Order# Action# Pred.Action# Succ.Action#
    ------ ------ ----------- ------------
    xxxxx xxxxxx AAAAAAA bbbbbb
    xxxxx xxxxxx bbbbbbbb cccccc


    Okay this is an example.

    lets say user selected
    cccccc

    quary should do this
    ccccc has bbbbbb as pred.action number,
    then it finds in again in succ.Action # bbbbb and its pred.Action number AAAAA

    each time i find the Predecessor it should go to table 1 and find it in using Action# and Order# and restrun the specific data

    okay use gives ccccc

    Now the result would be

    order# Action# data startDate EndDate
    ----- ----- -------- -------- --------
    XXXX bbbbb XXXXXXX XXXXXXx XXXXXX
    xxxxxx AAAA XXXXXXX XXXXXXX XXXXXXX


    I hope u got what i mean. Please help me. thanks

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    You'll probably need to pick a programming language, and then write the recursive code to do what you've described. I don't know of any feature in MySQL that will do that for you.

    -PatP

  3. #3
    Join Date
    Apr 2004
    Posts
    2
    Yes I am using Visual Basic 6 with sql. Could u please give me an idea how i can do this?

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    It would probably be better if you asked your teacher for help. They know what you've covered in class, what criteria they'll use for grading, and your programming environment than I do. Because of that knowledge, they can give you a much better answer than I can.

    -PatP

Posting Permissions

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