Search code examples
sqlitefmdb

select top 1 or get first record using FMDB


I am using FMDB and I just want to select a single record using TOP 1 - can you do this using FMDB? I have Googled and I haven't found this mentioned anywhere - seems like a pretty common usage scenario.

Anyone?


Solution

  • I don't know about fmdb, but it seems to use raw/prepared sql statements, so you can use the SQLite documentation:

    http://www.sqlite.org/lang_select.html

    You can see that it uses LIMIT 1 (like MySQL) instead of TOP 1 (like MS SQL)