I wanted to represent a hierarchical tree in a table. Unfortunately I chose a not very elegant way, by creating a table with as many columns as levels in the tree (see table t_old below). Now I want to change this. I created a new tables (t_new) which contains only three columns (id, structure and father_id).
Question: Is there a command, which fills me the new table (t_new) with the data of t_old without using a script with loops?
t_old
id l1 l2 l3 l4 ...
48 x
62 x sens. sys.
63 x sens. sys. eye
64 x sens. sys. eye lens primordium
65 x sens. sys. eye optic cup
66 x sens. sys. otic vesicle
t_new
id structure father_id
62 sensory system 48
63 eye 62
64 lens primordium 63
65 optic cup 63
66 otic vesicle 62
Thorsten
Question: Is there a command, which fills me the new table (t_new) with the data of t_old without using a script with loops?
t_old
id l1 l2 l3 l4 ...
48 x
62 x sens. sys.
63 x sens. sys. eye
64 x sens. sys. eye lens primordium
65 x sens. sys. eye optic cup
66 x sens. sys. otic vesicle
t_new
id structure father_id
62 sensory system 48
63 eye 62
64 lens primordium 63
65 optic cup 63
66 otic vesicle 62
Thorsten