check (phone like'[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]')
This is to check the phone number whether it has exactly 10 digits. But I have no idea about placing number as '[0-9]'
. It seems to be a string. So how can we check numbers inside string?
Can some one explain this query?
The type of column phone
is char(10)
.