I have my sql database where i would like to filter out all the valid mobile numbers.
I currently use as follows;
WHERE pn.PhoneNumber LIKE '+[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
OR pn.PhoneNumber LIKE '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
OR pn.PhoneNumber LIKE '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
OR pn.PhoneNumber LIKE '[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9]'
However I still receive numbers such as 0000000, 0 ,0000 etc.
Some of the numbers aren't Irish mobiles either as they don't begin with 08.
To fix there if I wanted the beginning of the number to begin with an 087 would I just input [0][8][7] instead of the [0-9]?
try testing this !
this'll give numbers starting with 087 and mobile(length)=10
select * from table where mobile_number like '087%' and LEN(mobile_number)=10
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With