1

我创建了这个 SQL 语句:

SELECT * 
    FROM forum_question 
        LEFT JOIN forum_answer ON (
            forum_question.id = forum_answer.question_id) 
    ORDER BY a_datetime DESC GROUP BY forum_question.id;

有谁知道这个问题?forum_question 和 forum_answer 以及 'id' 列由 by 存在。

4

1 回答 1

4

GROUP BY子句应该在ORDER BY子句之前。换个试试看

GROUP BY forum_question.id
ORDER BY a_datetime DESC 
于 2013-04-15T02:40:24.487 回答