我想獲取表數據,孩子的數據在另一個表中,但我不知道如何進行查詢。我知道怎么做的是一個普通的查詢 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 回答
- 0 關注
- 132 瀏覽
添加回答
舉報
0/150
提交
取消