On Sat, 25 Jun 2011 09:26:42 +0200, Cecil Westerhof
<cldwester...@gmail.com> wrote:

> With LIMIT you can get the first N records of a SELECT.
> Is it also possible to get the last N records?

Yes, I can think of two ways:

1- Reverse the ORDER BY (make it DESC), so you can use the exact
same LIMIT clause, 

2- replace the offset in the LIMIT clause by something like
(SELECT COUNT() WHERE ...)


It may not apply to your use case, but perhaps it helps anyway:
http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor
-- 
  (  Kees Nuyt
  )
c[_]
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to