这是我要运行的脚本:
$resultadosPromediados = R::getAll("SELECT count(*) as total,
SUM(dialogue_score) / total as dialogue_score,
SUM(consulta_general_score) / total as consulta_general_score,
SUM(tarea_score) / total as tarea_score,
SUM(foro_calificacion_score) / total as foro_calificacion_score,
SUM(foro_respuesta_score) / total as foro_respuesta_score
FROM ranking
WHERE created = :ultima_feha",
array(':ultima_feha' => $fecha));
print_r($resultadosPromediados);
但我得到这个错误:
致命错误:未捕获 [42S22] - SQLSTATE [42S22]:未找到列:1054 第 265 行 /home/ASDFASDF/public_html/ADSFADSF/rb.php 中的“字段列表”中的未知列“总计”
如何使用总行数除以它们的总和以获得平均读数?