0

I would like to ask for help with following I have table with following data about grouping of region:

|  ID  |  Name   |  Parent.ID  |

|  1   |  Europe |  null       |
|  2   | Germany |   1         |
|  3   | France  |   1         |
|  4   | Bavaria |   2         |
|  5   | Munchen |   4         |

How to create nested table in structure like:

Europe > Germany > Bavaria > Munchen

Thanks for help

MagicQ
  • 11
  • 5
  • The Joe Celko's book "Trees and hierarchies in SQL for Smarties" (https://books.google.bg/books?id=8NdQY8TuEDUC&printsec=frontcover&dq=joe+celko+trees+and+hierarchies&hl=bg&sa=X&ved=0ahUKEwin_Y-3tbXpAhVDw4sKHaRDCaEQ6AEIKTAA#v=onepage&q=joe%20celko%20trees%20and%20hierarchies&f=false) will show you the path. – IVO GELOV May 15 '20 at 08:10
  • 2
    https://stackoverflow.com/questions/20215744/how-to-create-a-mysql-hierarchical-recursive-query – Nick May 15 '20 at 08:16

0 Answers0