Michael, I would think this is what you want.
Select ID from T1 where ID BETWEEN (<id in question> - 1) and (<id in question> + 1) If you want distinct values, place the distinct keyword in front of ID (i.e. Select DISTINCT ID... This should do it for you. -Dan Hi, Does anyone have a clever way of returning; a requested value with one value less than that value, and one value greater than that value with one query. For example T1 contains ID 1234 1235 1236 1238 select ID from T1 where ID = 1235 and ID<1235 and ID >1235 LIMIT 3 (obviously this doesn't work) I would want to return.... 1234 1235 1236 or; select ID from T1 where ID = 1237 and ID<1237 and ID >1237 LIMIT 3 I would want 1236 1238 I would be surprised if there was no way of doing this.....but then again, I'm often surprised.... Thanks Michael -- Michael DePhillips www.star.bnl.gov -- Have a great day, Dan Julson Application Software Engineer API Outsourcing 1355 Mendota Heights Rd. Mendota Heights, MN 55120 651-675-2628 (work) 952-456-2067 (mobile) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]