String query = "SELECT SUM(totalcost) FROM"+m+""; //where totalcost is my column name
ResultSet rs=st.executeQuery(query);
while(rs.next())
{
System.out.println("SUM(user_id)="+rs.getString(1));
}
这段代码有什么问题?我的例外是:
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException:“字段列表”中的未知列“总成本”