答案 0 :(得分:2)
select value
from your_table
where 2.3 >= score
order by score
limit 1
根据您的数据库引擎,您需要更改limit 1
部分。只获取第一个记录数据库引擎有不同的方法。
答案 1 :(得分:0)
试试这个
select value
from tbl_in_between
where 2.3 between score and (score+0.5)
答案 2 :(得分:0)
在 SQL SERVER 中,您可以这样做:
DECLARE @Score NUMERIC(2,1)=2.3
SELECT TOP 1
FROM [YourTable]
WHERE Score<=@Score
ORDER BY Score
答案 3 :(得分:0)
你可以试试......
SELECT TOP 1 value
FROM tbl_in_between
WHERE Score <= 2.3
ORDER BY Score