Hi Alex,

If I understand you correctly, that would mean a separate query for each
product and if I have hundreds or thousands of products ... that doesn't
look very nice.

Regards,
Peter


Alexander Klimetschek wrote:
> 
> On Mon, Jan 11, 2010 at 09:59, Peter Dotchev <[email protected]> wrote:
>> Now, I want to get a list of products including the lowest price for each
>> product.
>> I don't see MIN/MAX mentioned in JCR 2.0 spec, so it seems they are not
>> support by repository queries. :(
>>
>> What approach would you recommend to fetch such a list from the
>> repository.
> 
> You can query all products and order by price, eg. in xpath something like
> this:
> 
> //*...@product='myproduct'] order by @price
> 
> with ascending or descending at the end, depending on the order. Only
> reading the first element from the result should be enough ;-)
> 
> Regards,
> Alex
> 
> -- 
> Alexander Klimetschek
> [email protected]
> 
> 

-- 
View this message in context: 
http://n4.nabble.com/min-max-query-tp1011086p1012075.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Reply via email to