> I thought about answering your original post except that I couldn't figure
> out what you want.  And after reading this, I'm even more confused.  What
> does it mean for id's to be sorted by last name?

Ok let me see if I can state thre problem better (though I think that I am begining to 
understand the magnatude of the task a little better from the answers by Adam and 
Ben), the problem may be that I don't have a real example only one that came to me as 
I was reading the section on indexes.

Given: a table a table "names" with  columns
id        - integer,primary key, auto_increment
first   - varchar(20)
last     - varchar(20)
the entries have not been made in alphabetical order.  But the table is indexed by 
last and first

Problem:  I know a row in the table, (I have an id,first and last).  I guess what I 
would want to know is the next row if the table were sorted by last,first.  

What I was wondering was if mysql had a way to use the index for this, kind of like, 
if I know the primary key for a row is there anyway to get the  primary key that is 
next in the index (since the index is kept sorted)?  Or am I conceptualizing the index 
incorectly?  SInce if I had the primary key writing a select statement is beginner 
stuff (and I am a beginner)

Now Ben did simplify the problem correctly as well I think:
- Run program, fetches a name.  Processes and exits.
 - Run program again, same SQL but gets the NEXT name.  Processes and exits.

Thanks,
   Sam D




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to