want a solution for this query.
I have a table like this,it contains a fields like id,originalid,filename

ID OriginalID FileName
100 0 abc.doc
101 100 a.doc
102 101 b.doc
103 102 c.doc
104 103 d.doc

suposse when i passed the id=104 the query should display above all records,because parent oigianlid is 103 for 104 and 102 for 102 and so on..

i passing 104 as a parameter to this query

so please send answer to this query