From 9cc81bb7bf06b028a4e056631c0d2a56eaeeb7d4 Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Fri, 4 Feb 2022 10:34:21 +0100 Subject: [PATCH] MDL-71696 question: Fix Oracle GROUP BY error - Round 2 --- report/questioninstances/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/report/questioninstances/index.php b/report/questioninstances/index.php index d7a4b1aff1219..726ba0b0ae92f 100644 --- a/report/questioninstances/index.php +++ b/report/questioninstances/index.php @@ -90,7 +90,7 @@ $ctxgroupby = implode(',', array_keys(context_helper::get_preload_record_columns('con'))); $counts = $DB->get_records_sql(" SELECT result.contextid, SUM(numquestions) AS numquestions, SUM(numhidden) AS numhidden, $ctxpreload - FROM (SELECT data.contextid, COUNT(data.numquestions) AS numquestions, + FROM (SELECT data.contextid, data.versionid, COUNT(data.numquestions) AS numquestions, (SELECT COUNT(qv.id) FROM {question_versions} qv WHERE qv.id = data.versionid