出现错误: 列“ u.username”必须出现在GROUP BY子句中或在聚合函数中使用。
我正在尝试内部连接表A和表B以及外部连接表C (((A内线B)外线C)
我在下面运行代码。
SELECT u.username, u.name, m.date, m.messages, u.profile_image, m.message_id,
COUNT(case current_vote when -1 then 1 else null end) AS post_down_vote,
COUNT(case current_vote when 1 then 1 else null end) AS post_up_vote
FROM Users u
INNER JOIN messages m ON u.user_id=m.sender_id
FULL OUTER JOIN message_vote v ON m.message_id = v.message_id
WHERE receiver_id = 18;
任何帮助将不胜感激。
谢谢!
答案 0 :(得分:2)
首先,您不需要consumer_task = asyncio.ensure_future(
copy_current_websocket_context(consumer)()
)
。其次,您只需要包括所有未聚合的列:
full join