0

我有一张记录分数的表。

当我使用这个查询分数的最大值时:

selectStmt = new SQLStatement();
selectStmt.sqlConnection = conn;
selectStmt.text="SELECT MIN(score) FROM highscores";
selectStmt.execute();

result = selectStmt.getResult();
    var data:Object = (result.data);
    for (var i:int = 0; i < data.length; i++) 
    { 
        var row:Object = result.data[i]; 
        var output:String = "score: " + row.score;  
        trace(output);
    }

输出返回一个未定义的值。

如何获得表格中的最高分?

4

1 回答 1

1

尝试selectStmt.text="SELECT MAX(score) AS maxScore FROM highscores";

于 2012-09-05T12:42:07.773 回答