I have got a very old database, where someone didn't keep valid format for data. So in my Column I have got values like that:
in column is 1234567890 expected 1234567890
in column is 12-345-678-9-0 foo expected 1234567890
in column is bar 1234-567-890 expected 1234567890
in column is 12-34567-foobar-890 expected 1234567890
etc.
I mean, there is a number (always 10 digits), with some other characters in random places.
I have got in my variable $number
the integer value of 10 digits.
I want to do some query like SELECT * FROM table WHERE Column = $number
, but I want to match all rows that has got this $number
, if I would clean my column to right format.
I have no idea, how can I do this :(