我正在尝试编写查询以显示由逗号分隔的posterTitle和corrosponding AVERAGE SCORES。但我没有得到它。
SELECT submission.postertTtle, GROUP_CONCAT(judge_review.avgPoints) as
avgPoints FROM submission,sub_judge,judge_review WHERE
submission.submissionID=sub_judge.sub_id and
sub_judge.judge_id=judge_review.j_ID GROUP by submission.postertTtle
Desired Output:
posterTitle | avgpoints
Conference | 5,3,1
new poster | 1.5,2
答案 0 :(得分:0)
select submission.postertTtle, GROUP_CONCAT(judge_review.avgPoints) as avgPoints
FROM submission
INNER join judge_review ON submission.submissionID=judge_review.sub_ID
GROUP by submission.postertTtle