Alright, so I have been trying for quite some time now to figure out
how to get an SQLite database in Android to count the instances of a
particular value in a table with no luck. I figured that the SQL
count command would work, but I haven't been able to figure out how to
use it yet.
My database is a modified version of the notepad tutorial one with
more (and larger) tables. What I am currently trying to do is get
android to return a Cursor that holds in one column the distinct
values in the "pass" table column and in the second column the number
of times that each string occurs. The following is the code that I
have been trying to make not crash android but to no avail.
mDb.query(DATABASE_TABLE_ACTION, new String[] {KEY_PASS}, "COUNT(" +
KEY_PASS + ")", null, KEY_PASS, null, null, null);
What am I doing wrong here?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---