[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Finding a maximum attribute value



Howdy!

Salvador Ramirez wrote:
[snip]
>  I have entries on a directory with an integer attribute. I'm
> interested on getting the entry on the directory with the maximum
> value on this attribute. How can I do this? I'm looking for
> something like a "select max(col)" of SQL but expressed on
> LDAP filters..

Sounds like a subtree search using some kind of sorting of the entries
you receive. You save the entry DN of the entry with the greatest
interger attribute before getting the next one. Base DN for the subtree
search is ofcourse the parentnode DN of the subtree you wish to explore.
If you use indexing you could speed the search but you still have to go
through the whole subtree.

If this sounds interesting I could give you details about the
search(without any specific filters).

Sinc. 
Mikael