我想知道是否有人可以阐明以下错误。sql 在本地工作正常,但我远程收到以下错误。
SQL查询:
$inQ = "
SELECT category.category_name, GROUP_CONCAT(subject.subjects SEPARATOR ', ') AS subjects
FROM category
INNER JOIN tutor_category_subject ON tutor_category_subject.category_id = category.category_id
INNER JOIN subject ON tutor_category_subject.subject_id = subject.subject_id
WHERE tutor_category_subject.tutor_id = $tutorId AND tutor_category_subject.category_id = $categoryId
";
MySQL 说:
#1140 - 如果没有 GROUP BY 子句,混合没有 GROUP 列的 GROUP 列 (MIN(),MAX(),COUNT(),...) 是非法的