我正在尝试执行以下查询,但我误用了聚合函数 sum()
询问
select max(sum(entry.amount)),category.name from entry,category where entry.amount<0 and entry.cid=category.cid group by category.name
LogCat 输出
android.database.sqlite.SQLiteException: misuse of aggregate function sum() (code 1): , while compiling: select sum(entry.amount),category.name from entry,category where entry.amount<0 and entry.cid=category.cid group by category.name 09-22 20:20:18.626: E/AndroidRuntime(4093): at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
有什么建议么 ?问候,兄弟