I am using MySQL to perform this operation. For example I want to select phone numbers that do not begin with ‘456’. What is the query to get tuples where the number does not begin with 456 and does not appear any where else.
I tried WHERE phone NOT LIKE '%456%' but that deselects all numbers with 456 in them.
List of phone numbers
Result I got. This removes all numbers with 456 in them. Not just ones at the beginning
>Solution :
None of your phone numbers begin with 456, they all begin with 1-. It seems like you want to check if the second part of the number is 456, not the beginning. So use
WHERE number NOT LIKE '%-456-%'

