我想获取表数据,孩子的数据在另一个表中,但我不知道如何进行查询。我知道怎么做的是一个普通的查询 select * form table 1,我知道如何执行“内连接”但我不希望表 1“父”中的数据重复select * form parent INNER JOIN childs on parent.pnt_id=childs.id_pnt;父母子女+-----+----------+------+-------+ +-----+----------+-------+ | id | pnt_id | info |infotwo| | id | id_pnt |n_child|... +-----+----------+------+-------+ +-----+----------+-------+ | 1| 5| home | big | | 5| 1| joan | +-----+----------+------+-------+ +-----+----------+-------+ | 2| 3| work | fat | | 3| 1| luci | +-----+----------+------+-------+ +-----+----------+-------+ | 3| 0| soft | thin | | 6| 2| troy | +-----+----------+------+-------+ +-----+----------+-------+我想以以下形式进行查询$parents = arrar ( info -> "home", infotwo -> "big", data_child -> arrar ( n_child -> "joan", n_child -> "luci" ))
1 回答
- 1 回答
- 0 关注
- 115 浏览
添加回答
举报
0/150
提交
取消