heero
heero

Reputation: 1971

Limit number of rows returned from sqlite

How can I limit the number of rows returned using activity.managedQuery()?

I am pretty sure there isn't a limit function in sqlite. I also do not want to use SQLiteDatabase.query() because I am using URI to get my queries.

Upvotes: 3

Views: 5290

Answers (1)

Julian
Julian

Reputation: 2101

Of course there is LIMIT in SQLite. See the SQLite docs. For example:

SELECT col1, col2 FROM mytable WHERE foo = 'bar' LIMIT 42;

Upvotes: 12

Related Questions