Re: Help- query for last x items

From: Brian Martin <icbkr_at_ix.netcom.com>
Date: 1996/09/10
Message-ID: <323609C4.5F7A_at_ix.netcom.com>#1/1


Jason Yeoung Zien wrote:
> Can anyone tell me how to efficiently query for the last X
> items in a sorted subset?
 

> One solution would be to just query without the "where" clause
> and to loop through the cursor and ignore the items outside
> of the proper range, but that seems inelegant.

You could try, with heavy emphasis on the words: caveat utilitor
to use the rowid. Query Max rowid, or number of records and then select where rowid in your range.

Not having ever attempted this (someone out there must have been burned by it) I think it will do a lot of what you want, but I'm certain you should find a better way.

rowid is like a drug, a little is great, too much will kill you, and once you
start using it, it's hard to stop.

bcmartin Received on Tue Sep 10 1996 - 00:00:00 CEST

Original text of this message