I am having a hard time figuring this one out so I came here for help.
I have a table x_25_operators which has a field called mask. Masks are numbers with length between 7-11 digits. What I am trying to achieve here is to find the best match for my query at this particular table.
Given the scenario:
x_25_operators
| some_other_data | mask
. 486737
. 616724
. 915776
I have a number: 48915776148 (this number is fixed-length, always 11 digits)
I am looking for a query which will return a row containing mask 915776 (or all rows fitting to this searched number as filtering best-matching-one out should be a piece of cake).
I was thinking of using LIKE as the filter but such query:
SELECT * FROM x_25_operators WHERE mask LIKE '48915776148'
returns an empty query (which should be kind of obvious).
I am using a mySQL database.
Any ideas how to tackle such problem? I am open to any suggestions.