I have tabel with id(int) and parentid(int) column.
I would like to build hierarchy from top group to lowest child group.
Most top group parentid value is NULL
How can I achieve this?
result should be:
- /254908416
- /362858460/468059136/317456352
- /362858460/871041025/387747840
etc
Data:
- 254908416;
- 362858460;
- 617330496;887656451
- 1966161919;362858460
- 1405662208;1966161919
- 1244715002;1966161919
- 1077692408;1966161919
- 791121919;362858460
- 837370882;791121919
- 1468407808;791121919
- 733566972;791121919
- 871041025;362858460
- 1860938766;362858460
- 887656451;362858460
- 367575040;362858460
- 1391026193;362858460
- 468059136;362858460
- 2078713856;362858460
- 182920208;1391026193
- 1964555247;1391026193
- 1592067076;1391026193
- 434356226;2078713856
- 1994440704;2078713856
- 752940031;871041025
- 387747840;871041025
- 1159417875;887656451
- 988534764;887656451
- 1777662972;887656451
- 1513630728;887656451
- 1554393071;468059136
- 882323488;468059136
- 317456352;468059136
- 2081736736;468059136
- 434795488;468059136
- 1106030556;468059136
- 873465892;468059136
- 1712364548;468059136
- 1190012893;367575040
- 66089944;367575040
- 1158434817;367575040
- 1393349632;367575040
- 1475515350;367575040
- 1091389440;367575040
- 302198784;367575040
- 1560301582;367575040
- etc...
asked
19 Aug '13, 04:50
Tanel
16●1●1●3
accept rate:
0%