If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > help with recursive quary

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-20-04, 22:00
woow woow is offline
Registered User
 
Join Date: Apr 2004
Posts: 2
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
Reply With Quote
  #2 (permalink)  
Old 04-21-04, 01:02
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,609
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
Reply With Quote
  #3 (permalink)  
Old 04-21-04, 06:10
woow woow is offline
Registered User
 
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?
Reply With Quote
  #4 (permalink)  
Old 04-21-04, 08:19
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,609
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On