Issue
I have a table in mysql which contains customers names and phone numbers and I want to select customers whose phone number contains only digits because some customer's phone number is wrong and contains special characters and letters.
Solution
Let say your table is called customer
, with column phone
, this query below returns rows where phone
is numbers only.
SELECT * FROM customer WHERE phone REGEXP '^[0-9]+$';
Answered By - Shuwn Yuan Tee
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.