查询是SELECT * FROM QuestionINNER JOIN Question_Answer ON Question.question_id = Question_Answer.question_idWHERE Question.question_group_id = 518问题表包含以下列:question_id|question_name|question_type|question_group_id|question_ask1 |100-105 | gr | 518 | question12 |100-105 | gr | 518 | question23 |100-105 | gr | 518 | question34 |100-105 | gr | 518 | question4Question_Answer包含以下列:question_id|question_answer_text|question_answer_id|question_answer_is_correct518 |Text1 |1107 |1518 |Text2 |1108 |1518 |Text3 |1109 |1518 |Text4 |1110 |1问题是它输出如下内容:question_id|question_name|question_type|question_group_id|question_ask|question_id|question_answer_text|question_answer_id|question_answer_is_correct1 |100-105 | gr | 518 | question1 | 518 |Text1 |1107 |11 |100-105 | gr | 518 | question1 | 518 |Text2 |1108 |11 |100-105 | gr | 518 | question1 | 518 |Text3 |1109 |11 |100-105 | gr | 518 | question1 | 518 |Text4 |1110 |1我要实现的是:1 |100-105 | gr | 518 | question1 | 518 |Text1 |1107 |12 |100-105 | gr | 518 | question2 | 518 |Text2 |1108 |13 |100-105 | gr | 518 | question3 | 518 |Text3 |1109 |14 |100-105 | gr | 518 | question4 | 518 |Text4 |1110 |1 最佳答案 修正数据,或修正联接。您的加入是:Question.question_id = Question_Answer.question_id但是,数据为:{1,2,3,4} {518}连接错误或数据错误。关于mysql - Mysql:仅连接表左表的第一行,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/31300668/
10-13 08:14