Let me describe the problem another way, too. It's related to
creating a paging interface to view many records. I figured that
people deal with paging all the time and the solution to my problem
may already be out there.
Typically when you access a single record via a top down method, i.e.
you page through records and then you click on a specific record, you
still have information that allows you to go back to the paging view.
But what do people do if:
(1) Somehow, while you're browsing a single record, the database is
updated and records are added. The order of the record that your
browsing within the entire list of records could be shifted. When
you go back to page view, you actually need to figure out the
position, within your overall result set, of the current record that
your browsing and then you have to figure out which 'new' page the
record appears on.
or
(2) You browse to a specific record via let's say a search, and then
you want to step back to page view to see where this record lives in
the overall result set. (I guess this problem is the same as (1), b/c
it's all about going from a detail view to a page view and figuring
out it's position relative to everything so you can form the pages
accordingly)
Is there a way to do this in MySQL through a query or do I need to
get the ENTIRE result set into, let's say PHP and figure it out, and
then do another query for just a page of results?
-James
On Mar 22, 2007, at 11:21 AM, James Tu wrote:
Is there some quick way to do the following in MySQL? (I know I
can use PHP to search through the result set, but I wanted to see
if there's a quick way using some sort of query)
Let's say I know that Joe is from Maine.
I want to do a query of all employees from Maine, ordered by hiring
date, and figure out where Joe falls in that list. (i.e. which
record number is he?)
-James
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?
[EMAIL PROTECTED]
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]