obi wrote:
> 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?
The sql to do what you want looks something like this:

select title, count(title) as count from notes group by title, order by 
count;

(You can drop the "order by count" bit if you don't care about sorting 
your results).
Transforming that into a mDB.query is left as an exercise for the student.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to