感谢大家: ()我有4个表格项目、要点、步骤和评论;
Project id name desc
points id name desc project_id
steps id desc points_id
comments id desc steps_id
我像这样写了查询
SELECT * FROM Project
INNER JOIN points ON points.project_id=Project.id
INNER JOIN steps ON steps.points_id=points.id
INNER JOIN comments ON comments.steps_id=steps.id
WHERE Project.id=333
one project has many points, points, has many steps, and it has many comments somthing like this, and i whant to get all results in one query otherwise it takes a lot of time get results :(( i have no idea what can i do to :((
是这样子的
**Project**
id :1,
name :"get",
**points**
id :1,
name :"points1", ///project "get" s point
project_id : 1,
id :2,
name :"points2", ///project "get" s point
project_id : 1,
**steps**
id :1,
name :"steps1", ///project "points2" s step
points_id : 2,
id :2,
name :"steps2",///project "points2" s step
points_id : 2,
**comments**
id :1,
name :"something", ///project "steps1" s comment
steps_id : 1,
id :2,
name :"something",///project "steps2" s comment
steps_id : 2,
) ) )))(如果有其他办法解决这个问题?谢谢支持 :())))))