Answer the question
In order to leave comments, you need to log in
How to store in mysql an interval "from N to infinity"?
There is a need to save several intervals in the database.
The structure is simple. Let's take two columns: "from" and "to". Integers.
When an interval has values on both sides, then everything is simple and clear.
for example
Answer the question
In order to leave comments, you need to log in
In databases, the absence of a value is denoted as NULL
.
WHERE ( Val >= ValFrom ) AND (( Val <= ValTo ) OR ( ValTo IS NULL ))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question