Is there a clean way to limit the number of hits from an SQLite3 SELECT
statement?
For example, I might query with SELECT * FROM myTable WHERE name='Smith';
realising I could encounter thousands of hits. I'd like SQLite3 to give me say the first 10 it encounters and then terminate the query. How do I do this?
If SQLite3 does not provide this immediately, is there anything I can edit in the SQLite3 source code from which I can rebuild?
Assume I'm in an environment where I have only one thread and I'd like control back in a reasonable time.
You're looking for the LIMIT
clause:
SELECT * FROM myTable WHERE name='Smith' LIMIT 10
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With