SET @value = 2;
SELECT * FROM table WHERE from > @value AND @value <= to;