[turba] no incremental id or timestamp. How can I get first 10 or last 10 records

Jon Parise jon@csh.rit.edu
Mon, 23 Apr 2001 17:19:02 -0400


On Mon, Apr 23, 2001 at 11:04:32PM +0200, Atif Ghaffar wrote:

> Our customer is asking for a feature (maybe others will ask for it too).
> When someone opens the contacts window, the last n records are
> displayed.

Just curious: What is their reasoning?
 
> so with an incremental id or a time stamp missing, how can one do it?
> I know the auto_incremental is mysql only stuff, but please think about
> adding a lastModifed field which may contain simply the unixtime. This
> should work for ldap too.

As a side note, the PEAR DB stuff has sequences, which are
portable, suitable replacements for "auto-incrementing" fields.
 
> so getting last 10 entries would be simply 'order by lastModifed DESC'
> and 'limit 10'
 
That's SQL specific, of course.  I don't recall whether LDAP has
an inherent notion of a "last modified" time for a given
attribute.  It might also require an additional field in the
schema.

-- 
Jon Parise (jon@csh.rit.edu)  .  Rochester Inst. of Technology
http://www.csh.rit.edu/~jon/  :  Computer Science House Member