Dan Kennedy-4 wrote:
> 
> 
>> Is there any way to fetch the very first record in the database and  
>> find the > id number?
> 
> The 'first record' is a malleable concept. You can find the record with
> the lowest rowid value with:
> 
>    SELECT ... FROM <table> ORDER BY rowid LIMIT 1;
> 
> 

Thank you, that worked. 

Two questions spring to mind however..

1.  How many records are processed by SQLITE to get you the lowest rowid
value this way, does it have any significant impact on memory?

2. The above statement gets the lowest rowid but there appears to be no
implicit statement to the direction of the ORDER BY clause. Can the
statement be reversed to get the highest rowid?

Thanks for all your help.
-- 
View this message in context: 
http://www.nabble.com/Fetch-first-non-sequential-record-tp21125757p21126226.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to