Matthias Matker wrote:You can use a subquery to find the max(value) where the value selected
> Vladimir M. Zakharychev schrieb:
> >> I have to limit the number of results without using ROWNUM or something
> >> like that. One hint was to use "JOIN".
> >> I have to select the 10 biggest persons from a table "persons"
> >> id, firstname, lastname, size, age
> >> WITHOUT using ROWNUM or "limitter" like this.
> >> Do you have any idea?
> >> Thanks a lot.
> > Strange requirement - care to explain why?
> It forbidden to use such "limiters", we ( students) should do this via a
> > I'd suggest using RANK() or
> That's right ;-)
> > How about just fetching the first 10 rows of the
> Cannot act like this.
> Thanks for your quick reply.
is not equal to the max(value) on the same table. This will give you
the second highest value. If you were to nest the subquery repeatedly
you can find the Nth highest value. Then you could just select the
rows where size >= the sub-selected 10th value. This is a horrible way
to write a query.
Learning assignments with restrictions like this are misguided at best
HTH -- Mark D Powell --
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.