On 1/30/06, Jacques Brignon <jacbrignon@stripped> wrote:
> I would like some advice on the various and best ways of finding the rank
> of the
> row which satisfies a given condition in a rsult set.
> Let's assume that the result set includes a field containing an identifier
> one of the table used in the query and that not two rows have the same
> for this identifier but that the result set does not contains all the
> sequential values for this identifier and/or the values are not sorted in
> predictable order.
> The brute force method is to loop through all the rows of the result set,
> the number is found to get the rank of the row. That does not seem very
> and it can be very time consuming if the set has a lot of rows.
use ORDER BY with a LIMIT of 1
your subject line needs work though - a "row number" has no meaning in a