Query with multiple values in a column

后端 未结 4 1265
忘了有多久
忘了有多久 2020-11-22 03:14

I have a table like:

id     name            children
1      Roberto         Michael,Dia
2      Maria           John,Alex
3      Mary            Alexandre,Dia         


        
4条回答
  •  灰色年华
    2020-11-22 03:45

    I would rather make different tables for children and parents something like this.

    Table for parents

    parent_id     name            
    1             Roberto         
    2             Maria           
    3             Mary     
    

    Table for children

    children_id  parent_id  name
    1            1          Michael     
    2            1          Dia 
    3            2          John
    

    .... and so on

提交回复
热议问题