I have mobile numbers in Oracle table column whose datatype is string
3451111111
923452222222
03451111211
I want SQL statement to select mobile numbers in this form 3451111113 only and check the length = 10.
I want a sub string that starts from character 3 and end at the end of string of length 10. It should neglect the 0, 92 at the beginning and start counting of string from 3 to onwards.
To select only values where the last 10 characters are all digits beginning with 3:
The filter will exclude for example
30 bananas
(the last 10 characters start with 3, but they are not all digits). It ignores any preceding characters, so for examplebanana3123456789
would be reported as3123456789
. It's not clear whether you want to exclude that as well.regexp_substr(str,'3\d{9}$')
gives you the portion of the string you want, if you just want to select it without filtering the results.