Re: [SQL] query to do a backward 'skip', possible with (index) optimization ?

From: Alain TESIO <alain_tesio(at)yahoo(dot)com>
To: Albert Loo <albertsql(at)hotmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] query to do a backward 'skip', possible with (index) optimization ?
Date: 2000-01-10 19:14:06
Message-ID: 20000110191406.1987.qmail@web302.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> > => select * from mytable where id
> < '12345' order by id desc limit 1;
>
> > - which returned the correct
> result '12344', but without optimization.

Just an idea : add another column
negative_id which is equal to -id and
reverse the test ...

Alain

__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

Browse pgsql-sql by date

  From Date Subject
Next Message Werner Fraga 2000-01-10 20:54:04 problems creating functions, triggers, and rules
Previous Message Tom Lane 2000-01-10 15:17:49 Re: [SQL] query to do a backward 'skip', possible with (index) optimization ?