On Wed, 19  2006 06:08:49 -0400, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Brannon King <[EMAIL PROTECTED]> wrote:
> It's too bad you can't do an offset
> of negative one so that it would start at the back. That should be darn
> fast. Something like:
>
> select rowid from table limit 1 offset -1;
>

Two ways to do this:

   SELECT rowid FROM table ORDER BY rowid DESC LIMIT 1;
   SELECT max(rowid) FROM table;

If the rowid column is a unique indexed column will select count(*)
only access the index to calculate the count? Would you need to
use  SELECT count( indexed_column ) instead of SELECT count(*)?

--
SqliteImporter and SqliteReplicator: Command line utilities for Sqlite
http://www.reddawn.net/~jsprenkl/Sqlite

Cthulhu Bucks!
http://www.cthulhubucks.com

Reply via email to