我有一个在我的网站上查找现实的请求,我在此请求中遇到了错误,而且我不知道要解决此错误需要做什么
错误:
“ quote_plus_normal_gr_publi.id_post_normal”列必须出现在GROUP BY子句中或用于汇总乐趣
查询:
SELECT
publi.date, publi.mess, publi, publi.profil, publi.color,
publi.name, publi.search
FROM
publi
INNER JOIN
(SELECT
id_post_normal, COUNT(id_post_normal)
FROM
quote_plus_normal_gr_publi
ORDER BY
id_post_normal) q ON q.id_post_normal = publi.id_post_normal
WHERE
publi.id_personnes = 1
ORDER BY
date DESC
答案 0 :(得分:0)
我认为您的选择陈述有误
SELECT publi.date, publi.mess, publi, publi.profil, publi.color, publi.name, publi.search
FROM publi
INNER JOIN (
SELECT id_post_normal, COUNT(id_post_normal)
FROM quote_plus_normal_gr_publi
ORDER BY id_post_normal
) q
ON q.id_post_normal = publi.id_post_normal
WHERE publi.id_personnes = 1
ORDER BY date DESC
在第一个选择中,只有publi且没有要调用的列
select publi.date, publi.mess, publi, publi.profil
所以我尝试查询并做出与您相似的信息,并且没有显示任何错误。
为什么错误会按组显示?您是否尝试其他查询?不是这个查询吗?