Suppose there is a table:

Число | Ответ 10000 | A 20000 | B 30000 | C 

If my number is 15000 - the answer should be A (from 10000 to 20000 )
If my number is 20001 - answer B

What should be the request to the database?

    1 answer 1

     SELECT `Ответ` FROM `Таблица` WHERE `Число` < @Число ORDER BY `Число`DESC LIMIT 1