Hi all,
I am currently working with java and database conenctivity(using MSAccess)
I have a table Tree which is as follows:
Nodeid index CNodeid
2 1 6
2 2 8
2 3 12
5 1 3
5 2 10
8 1 14
8 2 5.
Now I want the result to be in the following manner:
New Table
Nodeid index CNodeid
2 1 6
2 2 8
2 3 12
8 1 14
8 2 5.
5 1 3
5 2 10
------------------------------------------------------- just to show visually that it seperates
5 1 3
5 2 10
---------------------------------------------------------
8 1 14
8 2 5.
5 1 3
5 2 10
Let me explain whats happening in the above,
I am reading the values from each unique Nodeid and storing them in new table and if the Cnodeid of it matches with any of the Nodeid then I am again getting the resulting values/tuples from the Tree table and inserting into the new table.
This way if i follow, the resultant table will be as shown above.
And I am using vectors to store the intermediate CNodeid's and also all Nodeid's such that I can compare CNodeid and Nodeid and then insert appropriately into the new table.
But my code is not producing the entire result.
Its part of my assignment and my code if pasted here is too long because of which I am just posting where my problem is.
If someone can help me with the logic or writing a for loop for above then that is really appreciated.
Thanks!!