the table is very simple,pid means the parent id,and cid means the child id.And there may be more than one trees in the table.So my question is:
knowing several cid,how can we get the root ancestors
here is an example
pid cid
1 2
2 3
3 4
5 6
6 7
7 8
given cid = 4 or cid = 8,I want to get their root ancestors whose pid is 1 ro 5
finally,I'm using an oracle 10g