Accepted answer

it appears that you're using a static variables named database_table, key_rowid, and key_itemtype containing your actual names. when you use this with rawquery, you'll have to do

dbcursor = database.rawquery("select " + key_rowid + ", sum(" + key_itemtype + ") from " + database_table + " group by " + key_rowid, null);

notice that when you make the query using database.query you don't have these variables in quotes, that's why it works.


not sure if the sum() aggregate is causing you trouble, but you can double check the table's existence using the sqlite command line and the ".tables" command:

sqlite3 database
sqlite version 3.7.8 2011-09-19 14:49:19
enter ".help" for instructions
enter sql statements terminated with a ";"

Related Query

More Query from same tag