En enkel
SELECT * FROM autumn.ip WHERE :number-constant >= start
ORDER BY start DESC LIMIT 1
UNION
SELECT * FROM autumn.ip WHERE :number-constant <= end
ORDER BY start ASC LIMIT 1;
borde fungera.
MEN, låt mig ifrågasätta din forskningskvalitet...