Re: select the next name

2003-01-14 Thread Benjamin Pflugmann
On Tue 2003-01-14 at 09:22:40 -0500, [EMAIL PROTECTED] wrote: > > One solution could be something like > > > > SELECT id, first, last > > FROM names > > WHERE last > '$previouslast' AND first > 'previousfirst' > > ORDER BY last, first > > LIMIT 1 [...] > I don't think it would loop for

Re: select the next name

2003-01-14 Thread Ronald Beck
It seems you want something like select * from table limit 1,1 for the first query and then... select * from table limit 2,1 You might also want to add "order by" as well to assure the proper order each query. HTH, Ron [EMAIL PROTECTED] wrote: > Now Ben di

RE: select the next name

2003-01-14 Thread mySQL_list
> 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 unders

Re: select the next name

2003-01-14 Thread Nicholas Elliott
> One solution could be something like > > SELECT id, first, last > FROM names > WHERE last > '$previouslast' AND first > 'previousfirst' > ORDER BY last, first > LIMIT 1 > > That is: Take all results that "come after" the previous name, sort > them and then take only the first. > > The

Re: select the next name

2003-01-14 Thread Benjamin Pflugmann
Hi. On Tue 2003-01-14 at 06:02:10 +, [EMAIL PROTECTED] wrote: > > SELECT id,first,last FROM names ORDER BY id LIMIT 2,1; > > > > Work? Limits to one result, start at second offset. (I may have the 2,1 in > > the wrong order though) > > Ok my gut would say that this would not give the result

RE: select the next name

2003-01-13 Thread Adam Erickson
> Ok my gut would say that this would not give the result I want > unless the id's are sorted by last name, and given inserts and > such I can see that would not be the case. But I sense the > glimmer of an approach in this query... You're right, I don't know why I thought you wanted to sort by

RE: select the next name

2003-01-13 Thread Paul DuBois
At 6:02 + 1/14/03, [EMAIL PROTECTED] wrote: > SELECT id,first,last FROM names ORDER BY id LIMIT 2,1; Work? Limits to one result, start at second offset. (I may have the 2,1 in the wrong order though) Ok my gut would say that this would not give the result I want unless the id's are s

RE: select the next name

2003-01-13 Thread mySQL_list
> SELECT id,first,last FROM names ORDER BY id LIMIT 2,1; > > Work? Limits to one result, start at second offset. (I may have the 2,1 in > the wrong order though) Ok my gut would say that this would not give the result I want unless the id's are sorted by last name, and given inserts and such I

RE: select the next name

2003-01-13 Thread Adam Erickson
Would: SELECT id,first,last FROM names ORDER BY id LIMIT 2,1; Work? Limits to one result, start at second offset. (I may have the 2,1 in the wrong order though) > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 13, 2003 10:20 PM > To: [EM