Skip to Main Content

Berkeley DB Family

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to order and limit a xquery resultset at once?

604754Jun 17 2008 — edited Jun 23 2008
Hi, I am trying to do the following:

let $hits := (for $hit in /feature order by $hit/title descending return $hit) return $hits[position() = (1 to 2)]

to get an ordered resultset which can be limited to some hits (paged view in web interface).
But it seems when I limit the results, I get the database internal order.
Calling:

let $hits := (for $hit in /feature order by $hit/@title descending return $hit) return $hits

without limiting the resultset works as expected and returns the elements in the expected order.
Do you have any suggestions how I could get this to work?

Greetings
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 21 2008
Added on Jun 17 2008
7 comments
2,578 views