I'm using FMDB in my iPhone app (pretty new to it!) and want to limit the number of rows in a table to a certain value. whenever I insert new records, I want to check if some maxNumberOfEntries is excessed and if so, delete the oldest entries. I tried the following:
(...)
[db beginTransaction];
[db executeUpdate: @"DELETE FROM table_name WHERE someId = ? ORDER BY date LIMIT 10", [NSNumber numberWithInt: 123], nil];
[db commit];
(...)
but it seems like sqlite does not recognize the "LIMIT"-part of the query. How can I manage to delete a certain number of rows in a table without directly specifying the entry I want to delete?