In MySQL, I am trying to find rows with values matching the pattern. In my data, the pattern that I am using is 401.%, 402.%, 403.%, 404.% and 405.%. In other words, I am trying to find any floating number between 401 and 405. In addition, these number is stored as varchar. It is a string. So far, I have tried the following code, but in vain:
select * from my_table where my_column like '401.%'
and so forth.
Could you think of a way to make this work? Thanks for your help in advance.
LIKEoperator treat[1-5]? It searches for this exact string and since you don't have one - it fails to return anything.my_column REGEXP '^40[1-5]\.'