我正在使用mariaDB,codeigniter php
但是,当我使用php codeigniter运行相同的过程时,它会返回不同的结果集。
array(1) {
[0]=>
array(1) {
[0]=>
array(2) {
["stuScore"]=> string(7) "44.0000"
["answerdQues"]=> string(2) "50"
}
}
}
Run Code Online (Sandbox Code Playgroud)
查询过程...
SELECT sum(Score) as stuScore, count(distinct ta1.idTestQuestion) as answerdQues
FROM (select ta0.*, @running_time := if(@running_student = idStudent, @running_time, 0) + ta0.TimeTaken, date_add(ta0.StartTime, INTERVAL @running_time SECOND) as running_time, @running_student := idStudent
from (select tap.idStudent, ta.score, ta.idTestQuestion, tap.StartTime, ta.TimeTaken
from `testanswerpaper` tap
left join testanswer ta on ta.idTestAnswerPaper = tap.idTestAnswerPaper and (ta.Status = 'Flagged' || ta.Status = 'Answered')
where tap.`idTestQuestionPaper` …Run Code Online (Sandbox Code Playgroud)