Filter a field according to the format of the text

4

Can I filter the following formatting in a particular mysql field: (21) 2222-2222. I ask the understanding of the colleagues if I was not clear in my doubt, because I had a problem in the register of which the mask: $("#telefone").mask("(99)9999-9999"); was $("#telefone").mask("(99) 9999-9999"); and this gave problem here.

    
asked by anonymous 19.05.2016 / 17:25

1 answer

3

You can filter the numbers with like using the wildcard for a _ character.

SELECT * FROM tabela WHERE telefone like '(__)____-____'

Related:

What is undescore for "_" in MYSQL LIKE?

    
19.05.2016 / 17:29