I have a table like below:
The record of id = 1, means that value >0 and value <=200.
The record of id = 2, means that value >200 and value <=1500.
The values are ordered by such analogy.
Now I have a value of 4000, I want to get the corresponding id value(should be 3).
Are there better way to write SQL compare with?
select * from table_name where value >=4000 and rownum = 1;