0
    SELECT ma_forum.*, ma_forum_cat.*
    FROM ma_forum, ma_forum_cat
    JOIN ma_forum_comentarios ON ma_forum_comentarios.not_id = ma_forum.not_id
    WHERE ma_forum.notcat_id=ma_forum_cat.notcat_id AND ma_forum.notcat_id='".$notcat_id."' 
    AND ma_forum.not_status='Ativo'
    GROUP BY ma_forum.not_id
    ORDER BY MAX(ma_forum_comentarios.comnot_data) DESC

“on 子句”中的未知列“ma_forum.not_id”

4

1 回答 1

0

not_id表中不存在该列ma_forum

如果该列确实存在,请尝试以下操作并报告回来。

SELECT ma_forum.*, 
       ma_forum_cat.*
FROM   ma_forum JOIN 
       ma_forum_cat ON ma_forum.notcat_id = ma_forum_cat.notcat_id JOIN 
       ma_forum_comentarios ON ma_forum_comentarios.not_id = ma_forum.not_id
WHERE  ma_forum.notcat_id = '$notcat_id' AND 
       ma_forum.not_status= 'Ativo'
GROUP BY ma_forum.not_id
ORDER BY MAX(ma_forum_comentarios.comnot_data) DESC
于 2012-09-23T21:26:16.183 回答