Re: previous and next query

2006-08-04 Thread Jay Pipes
On Fri, 2006-08-04 at 17:14 -0700, Tanner Postert wrote: > select text from table where user = 2 and id < 3 order by id ASC limit 1; > select text from table where user = 2 and id > 3 order by id ASC limit 1; > > is it possible to do this using 1 query? select text from table where user = 2 and

previous and next query

2006-08-04 Thread Tanner Postert
so i have a record set: id user text 1 2 ... 2 6 ... 3 2 ... 4 4 ... 5 2 ... 6 8 ... 7 1 ... 8 8 ... 9 2 ... so lets say I am looking at record 3. i need to know the previous record in the table that has that user, as well as the next record in the table that has that user. r