I'm still confused, are you saying that you want to know what page a team would be on if you did a listing?
Regards, Jerry Schwartz Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 > -----Original Message----- > From: news [mailto:[EMAIL PROTECTED] On Behalf Of Gareth Adams > Sent: Wednesday, October 18, 2006 11:47 AM > To: mysql@lists.mysql.com > Subject: Re: Finding the 'page' number of a record, or its > position in resultset > > Jerry Schwartz <jschwartz <at> the-infoshop.com> writes: > > > Can't you just keep track of which page you are on, and > multiply by 20 > > (except for the last page)? I must be missing something. > > > > Regards, > > Hi Jerry, > > The problem is that the page isn't necessarily known at the > time we need to find > out its position. > > As a simple example, finding a team's position in a large > league, based on > "ORDER BY score DESC, errors ASC". The team may not have been > accessed from the > paginated league-table list. > > Maybe one solution would be to run the full query but only > select the primary > key, and then do searching in the application, but this seems > a little messy, > and still has to transfer a long dataset out to the > application only for most of > it to be discarded. Since MySQL has to collate a query, it > seems strange that > there's no kind of "SELECT ROW_NUMBER(), ..." which could > then be used in a > subquery or something (maybe not very efficient, but still > more efficient than > passing the entire resultset to the application where the > searching could easily > be slower depending on the language) > > Just my $0.02 > > Gareth > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: > http://lists.mysql.com/[EMAIL PROTECTED] > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]