以下代码是查询的一部分。我似乎对AND ON C2.loginid = S2.loginid
代码的部分格式有误。我应该使用什么格式?
提前致谢,
约翰
LEFT JOIN (
SELECT S2.loginid, COUNT(1) AS total
FROM submission S2
INNER JOIN comment C2
ON C2.submissionid = S2.submissionid
AND ON C2.loginid = S2.loginid
GROUP BY S2.loginid
) scs ON scs.loginid = l.loginid
答案 0 :(得分:1)
AND ON C2.loginid = S2.loginid
==>在ON
AND
LEFT JOIN (
SELECT S2.loginid, COUNT(1) AS total
FROM submission S2
INNER JOIN comment C2
ON C2.submissionid = S2.submissionid
AND C2.loginid = S2.loginid
GROUP BY S2.loginid
) scs ON scs.loginid = l.loginid