Search code examples
mysql

MySQL Not Equal To Certain Length


I have a table with a Phone_Numbers column. I want to delete all rows that do not have the exact length of 10 digits.


Solution

  • Before asking a question you should try, and if you don't succeed please provide the code you wrote.

    You can use the LENGHT fonction :

    DELETE FROM table_name WHERE LENGTH(Phone_Numbers) != 10