Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7686541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:30:15+00:00 2026-05-31T19:30:15+00:00

I have a table with a phone column, where data may have spaces, dots,dashes

  • 0

I have a table with a phone column, where data may have spaces, dots,dashes or + signs between the numbers.
I need to do a search with LIKE wildcards that ignore all those characters, for example:

  • a record may have phone as “+123-456 78.90”
  • a query looking for “6789” or any complete or incomplete sequence of proper digits in order should bring up that record.

Unfortunately I cant cleanup the original table to remove the non-digit characters and do a plain SELECT LIKE %…%.

MYSQL has functions to substitute/remove characters from strings, but can’t find a way to use them inside a query with a widlcarded LIKE.

Any help will be much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T19:30:16+00:00Added an answer on May 31, 2026 at 7:30 pm

    I see two ways doing this:

    1. If you allow only a few extra characters than you can prepare a string which is stripped from these extra characters and you use the LIKE operator you normally would

      select * from phoneTable where replace(replace(phone, '+', ''), '-', '') LIKE '%123%'
      

      Of course you need as many replace calls as the number of allowed extra characters

    2. You use regular expressions, let’s say you are searching for pattern 123

      select * from phoneTable where phone REGEXP '.*1[^0-9]*2[^0-9]*3'
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table which is full of arbitrarily formatted phone numbers, like this
I have a DataGrid table with columns name , phone . In column name
I have a table containing cells with phone numbers. How can I allow the
I have two table like this table_CN (_id, name, phone, favorite, title) table_EN (_id,
I have a SQL statement that looks like: SELECT [Phone] FROM [Table] WHERE (
I have 2 tables that look like this: Table public.phone_lists Column | Type |
I have table for comunication between clients and operaters, which contains phone, id (1=client,
I have my table schema and data something like this CompanyCategoryId SubCategoryId CategoryId CompanyId
I have two table with different column like this: table1 ( _id, title, name,
I have two columns in my SQL table where the phone numbers are stored.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.