I have a problem that is, I trying to retrieve data from database to the extent.
I explain very Clearly,
I have a table named: details.mdf
Fields: sponsor, nameofmember, memberid, dateofjoining
Q0000 ashi Q0001 12-20-2009
Q0000 sfgsf Q0002 13-20-2009
Q0001 dghdh Q0003 12-20-2009
Q0000 tyety Q0004 12-20-2009
Q0001 gdhdgh Q0005 12-20-2009
Q0003 gdh Q0006 12-20-2009
Q0002 ghf Q0007 12-20-2009
what can i do for result like this below:
sponsor of Q0006 , answer is : Q0003 and then who is the sponsor of Q0003 , answer is: Q0001 etc......
Thus dynamically retrieve the datas from database . I think, for this we can use loop. but I dont know what is the correct code for this purpose because of all the values are string . Please help me to retrieve datas in this manner?
thanks in advance

Suthish NairPosted Feb 8, 2011, 2:39 PM
Krishna GaradPosted Feb 8, 2011, 6:43 AM
select e1.nameofmember 'Sponcer',e2.nameofmember 'Sponcer2'
from tree e1 join tree e2
on e1.sponsor=e2.memberid
jaheena jamalPosted Feb 8, 2011, 6:40 AM
jaheena jamalPosted Feb 8, 2011, 6:24 AM
Krishna GaradPosted Feb 8, 2011, 5:53 AM
jaheena jamalPosted Feb 8, 2011, 5:49 AM
Krishna GaradPosted Feb 8, 2011, 5:06 AM
ReferThis
jaheena jamalPosted Feb 8, 2011, 5:03 AM
Krishna GaradPosted Feb 8, 2011, 4:06 AM