[thelist] selecting above and below ranges in a SQL query [long]

Jay Blanchard jay.blanchard at niicommunications.com
Mon Aug 26 13:19:00 CDT 2002


[snip]
you'll need to sort, in order for this to work
...
if mysql did unions, it would be one query
...
> The desired outcome is to get the one equal to (if there is a match),
>  the 3 above, and the 3 below that value, so that the value stated in
> the query (1.5) returns (there is no row matching 1.5);

you actually want 0 results if you don't match an existing value?

or do you want 6 rows instead of the 7 you'd get with a match?
[/snip]

No, it's not really a string, just force of habit when typing :^] . That
works great, the only problem that I have is that MySQL does not support
UNION, so I am still stuck with 2 queries (unless there is another
solution), which is better than the alternative of what could have been 7
total queries to get the table range. I want the 6 if there is not seven
rows.

Thanks Josh and rudy , you 'da men, I am just 'da man talkin' to da' men.

Jay





More information about the thelist mailing list