我想獲取表數(shù)據(jù),孩子的數(shù)據(jù)在另一個(gè)表中,但我不知道如何進(jìn)行查詢。我知道怎么做的是一個(gè)普通的查詢 select * form table 1,我知道如何執(zhí)行“內(nèi)連接”但我不希望表 1“父”中的數(shù)據(jù)重復(fù)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 | +-----+----------+------+-------+ +-----+----------+-------+我想以以下形式進(jìn)行查詢$parents = arrar ( info -> "home", infotwo -> "big", data_child -> arrar ( n_child -> "joan", n_child -> "luci" ))
- 1 回答
- 0 關(guān)注
- 123 瀏覽
添加回答
舉報(bào)
0/150
提交
取消