hire_date BETWEEN ‘2000-01-01’ AND ‘1990-01-01’
hire_date BETWEEN ‘1990-01-01’ AND ‘2000-01-01’
Result: Hiring dates between the condition
In the 1st case, why the result is being shown as NULL whereas in the 2nd it shows the accurate results?
Thanks for reaching out.
It is normal to obtain non-null results only in the second case because numbers grow linearly from smaller to bigger when using BETWEEN-AND. That’s why with your first query, where you indicate the interval from a bigger to a smaller date value, you obtain an empty output, while with the second query, where the interval has been indicated from a smaller to a bigger date value, you obtain an output containing many rows of data.
Hope this helps.
The 365 Team
Thanks, it was surely helpful!!
Great! You are welcome!