inner Join or self query

20 views Asked by At

I have a table with 3 columns

column 1 called URI with values : 1,2,3,4,5,6, Column 2 called record type with values : box, folder, box, folder, item, folder Column 3 called parent URI with values : 0,2,0,4,4,1

Basically the table has information about record number ( uri),what it is ? a box, folder or item ( record type) , and the URI of its container ( parent uri)

so ideally an item should exist in a folder and a folder in a box. and there cases where a record is orphan

Need to write a query that can show in perhaps 4 columns

uri, record type, parent uri, and parent uri record type

I think it can be done because a row like

3,box, 5 means record number 3 is a box and its parent is 5. there will exist another row that will have 5 as a uri , its record type and its parent.

Help regards

0

There are 0 answers