Mysql六表连接代码不起作用

时间:2012-12-05 07:38:08

标签: mysql sql database

当前的MySQL查询:

SELECT A.* 
FROM std_results_lev1_sem1 A JOIN std_results_lev1_sem2 B
     ON A.std_id = B.std_id
     JOIN std_results_lev2_sem1 C
     ON B.std_id = C.std_id
     JOIN std_results_lev2_sem2 D
     ON C.std_id =D.std_id
     JOIN  std_results_lev3_sem1 E 
     ON D.std_id = E.std_id
   JOIN  std_results_lev3_sem2 F 
     ON E.std_id = F.std_id
ORDER BY std_id ASC;

所有这些表都有相同的std_id

1 个答案:

答案 0 :(得分:2)

按顺序排列的std_id是不明确的。

ORDER BY A.std_id ASC;