I am trying to find a number in a column (a varchar column) using LIKE, I am using a statement like this SELECT * FROM MYTABLE WHERE mynumberslist LIKE '%76%'. The data is stored like this: nums=;76;78;80;81;176; So how do I go about searching for 76 because if I just do LIKE %76% I will get 76 and 176 returned is there anyway around this? I did not design the database, and have no control over the data that is stored, I am only responsible for writing a program that gets the data out.
I am trying to find a number in a column (a varchar column) using
Share
Use regex matching:
This will match even if you don’t have a trailing
;at the end – it matched the word 76 (\bmeans “word boundary” in regex)