List:General Discussion« Previous MessageNext Message »
From:Jacques Brignon Date:January 30 2006 2:14pm
Subject:Finding the row number satisfying a conditon in a result set
View as plain text  
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 from
one of the table used in the query and that not two rows have the same value
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 any
predictable order.

The brute force method is to loop through all the rows of the result set, until
the number is found to get the rank of the row. That does not seem very clever
and it can be very time consuming if the set has a lot of rows.


--
Jacques Brignon
Thread
display a hierarchic treeJochen Kaechelin29 Jan
  • Re: display a hierarchic treePeter Brawley29 Jan
  • Re: display a hierarchic treemysql29 Jan
  • Re: display a hierarchic treeGleb Paharenko30 Jan
    • Finding the row number satisfying a conditon in a result setJacques Brignon30 Jan
      • Re: Finding the row number satisfying a conditon in a result setJake Peavy30 Jan
    • Re: display a hierarchic tree(Pete Harlan)30 Jan