Run Code  | API  | Code Wall  | Users  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

postgresql example hierarchy with addresses

Language: Layout:
absolute service time: 0,52 sec 
fork mode |  history  | discussion
   address_id value parent_id
1 1 Europe 0
2 7 Radyscheva 5
3 3 Poland 1
4 2 Ukraine 1
5 6 Krakow region 3
6 8 Krakow city 6
7 4 Kyiv region 2
8 5 Kyiv city 4
9 10 Cherkassy region 2
10 9 Vrozlav region 3
   address_id value parent_node level
1 1 Europe 0 0
2 2 Ukraine 1 1
3 4 Kyiv region 2 2
4 5 Kyiv city 4 3
5 7 Radyscheva 5 4
6 10 Cherkassy region 2 2
7 3 Poland 1 1
8 6 Krakow region 3 2
9 8 Krakow city 6 3
10 9 Vrozlav region 3 2