Dennis Volodomanov <info-+Tq6r2yh00lWk0Htik3J/[EMAIL PROTECTED]> wrote:
Hello all,
I can't seem to figure out a working SQL for the following condition,
and I'm not sure if it's possible in SQL at all (but hope it is).
Let's say I have a simple schema:
CREATE TABLE MyTable ( ID INTEGER PRIMARY KEY, SomeData )
What I'd like to get is 5 records (for example) that are immediately
before a given ID (where before means their ID is less than).
select * from MyTable
where ID < ?
order by ID desc limit 5;
Igor Tandetnik
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------