3

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.

General Grievance
  • 4,555
  • 31
  • 31
  • 45
heero
  • 1,941
  • 5
  • 23
  • 33
  • 3
    I'm pretty sure there IS a `limit` http://stackoverflow.com/questions/2497677/using-the-limit-statement-in-a-sqlite-query#2497689 – JKirchartz Mar 27 '12 at 19:39

1 Answers1

12

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

SELECT col1, col2 FROM mytable WHERE foo = 'bar' LIMIT 42;
Julian
  • 2,051
  • 2
  • 22
  • 30