clickhouse修复
This commit is contained in:
@@ -61,13 +61,20 @@ public sealed class ClickHouseAnalyticsController(
|
||||
GROUP BY attendanceDate ORDER BY attendanceDate
|
||||
""", cancellationToken);
|
||||
var grades = await client.QueryAsync($"""
|
||||
SELECT academicTermId, academicTermName, studentCount,
|
||||
round(weightedScore / nullIf(studentCount, 0), 2) AS averageScore,
|
||||
round(passedCount / nullIf(studentCount, 0), 4) AS passRate
|
||||
FROM
|
||||
(
|
||||
SELECT academicTermId, any(academicTermName) AS academicTermName,
|
||||
sum(studentCount) AS studentCount,
|
||||
round(sum(averageScore * studentCount) / nullIf(sum(studentCount), 0), 2) AS averageScore,
|
||||
round(sum(passedCount) / nullIf(sum(studentCount), 0), 4) AS passRate
|
||||
sum(averageScore * studentCount) AS weightedScore,
|
||||
sum(passedCount) AS passedCount
|
||||
FROM {options.Database}.gradeStatistics FINAL
|
||||
WHERE 1 = 1{collegeFilter}
|
||||
GROUP BY academicTermId ORDER BY academicTermName
|
||||
GROUP BY academicTermId
|
||||
)
|
||||
ORDER BY academicTermName
|
||||
""", cancellationToken);
|
||||
|
||||
// Audit data has no college dimension, so it is never exposed to a
|
||||
|
||||
Reference in New Issue
Block a user