Join one row to multiple rows in another table

前端 未结 3 1444
无人共我
无人共我 2020-12-24 12:32

I have a table to entities (lets call them people) and properties (one person can have an arbitrary number of properties). Ex:

People

Name  Age
---         


        
3条回答
  •  臣服心动
    2020-12-24 13:15

    SELECT x.name,(select GROUP_CONCAT(y.Properties SEPARATOR ', ')
    FROM PROPERTIES y 
    WHERE y.name.=x.name ) as Properties FROM mst_People x 
    

    try this

提交回复
热议问题