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


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to