En simpel
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;
burde virke.
MEN, lad mig stille spørgsmålstegn ved din forskningskvalitet...