What SQL do I use to see if a number is within plus or minus a number?
Say -/+ 10 with 10 as the start point
Would retrive: 7,13,1
but not: 21, -5
???
Thanks in advance
SELECT -/+ Number
Moderator: General Moderators
- mikeeeeeeey
- Forum Contributor
- Posts: 130
- Joined: Mon Jul 03, 2006 4:17 am
- Location: Huddersfield, UK
SELECT -/+ Number
Last edited by mikeeeeeeey on Tue Jan 15, 2008 6:48 am, edited 2 times in total.
Re: SELECT -/+ Number
[sql]SELECT a FROM TABLE WHERE a BETWEEN $start_point - $interval AND $start_point + $interval[/sql]
There are 10 types of people in this world, those who understand binary and those who don't
- mikeeeeeeey
- Forum Contributor
- Posts: 130
- Joined: Mon Jul 03, 2006 4:17 am
- Location: Huddersfield, UK
Re: SELECT -/+ Number
Thanks, it seems really silly now I think about it. ah well
Is there any way do something similar to explode() in SQL?
Is there any way do something similar to explode() in SQL?
Re: SELECT -/+ Number
The closest one I am to able find is http://dev.mysql.com/doc/refman/5.0/en/ ... nction_elt
There are 10 types of people in this world, those who understand binary and those who don't