Need to get the data from DB based on the a column and the range is provided.
I have a student table with ID in it.
when i query the table on given range of id i.e between 10-20 then it is returning correct results.
ID is Varchar
SELECT *
FROM student
WHERE id BETWEEN 'AB10' AND 'AB20'
but lets suppose one of the range is not provided as range
1. ID from empty
2. ID to AB20
then ideally it should return from starting one to the provided id but i am getting no rows.
My query is
SELECT *
FROM student
WHERE id BETWEEN 'null' AND 'AB20'