gpt4 book ai didi

java - SQLite 平均分

转载 作者:行者123 更新时间:2023-12-02 02:56:13 26 4
gpt4 key购买 nike

PreStatement = myConnection.prepareStatement(""
+ "SELECT Game1.AVG(Score),Students.FirstName,Students.LastName "
+ "FROM Game1 "
+ "INNER JOIN Students "
+ "ON Game1.StudentID = Students.StudentID "
+ "ORDER BY Students.FirstName ASC;");

这不起作用。 (错误肯定是AVG分数部分)
但这确实如此。

PreStatement = myConnection.prepareStatement(""
+ "SELECT AVG(Score),
+ "FROM Game1 "

我是否做错了什么,或者我是否需要做两个陈述才能得到我的平均分数。

最佳答案

试试这个。

PreStatement = myConnection.prepareStatement(""
+ "SELECT AVG(Game1.Score),Students.FirstName,Students.LastName "
+ "FROM Game1 "
+ "INNER JOIN Students "
+ "ON Game1.StudentID = Students.StudentID "
+ "ORDER BY Students.FirstName ASC;");

关于java - SQLite 平均分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43043295/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com