我有一个数据库创建并提交数据。有一列我想找到最大的价值。
原文链接:https://www.f2er.com/sqlite/197975.htmlpublic Cursor getBiggestInTheColumn() { return db.query(DATABASE_TABLE,null,"MAX(price)",null); }
cursor = dbadp.getBiggestInTheColumn();
我得到像这样的运行时错误(LogCat):
07-14 12:38:51.852: ERROR/AndroidRuntime(276): Caused by: android.database.sqlite.sqliteException: misuse of aggregate function MAX():,while compiling: SELECT * FROM spendings WHERE MAX(price)