这是我的名为 Cruise_Serial 的数据库表:
我想得到每个cruiseID的总平均评价数,例如:
对于 CruiseID 4013,它必须是:(5+5+4+4+3+4+4+5+4+4+4+4)/12 这里是我为 PreparedStatement 写的:
PreparedStatement ps = connect1.prepareStatement("SELECT CRUISE_SERIAL_NUMBER, AVG(CRUISE_SERIAL.EVALUATION_FOOD, CRUISE_SERIAL.EVALUATION_SEHEDULE, CRUISE_SERIAL.EVALUATIONA_COMFORTABLE,CRUISE_SERIAL.EVALUATION_TIDY),AVG(CRUISE_SERIAL_NUMBER) "
+ "FROM CRUISE_SERIAL GROUP by CRUISE_SERIAL_NUMBER");
但是错误显示在我的这行代码中,请帮助我如何修复它。谢谢!!
Exception in thread "main" java.sql.SQLSyntaxErrorException: Lexical error at line 1, column 21. Encountered: "\uff3f" (65343), after : "".
at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
at org.apache.derby.client.am.ClientConnection.prepareStatement(Unknown Source)
at lab.User_Cruise.cruiseEvaluation
30秒到达战场
相关分类