6
I came across some cases where users reported me not in the database, certain clients, I noticed that it is common to abbreviate the middle names or the absence of them, for example:
Name: João Ferreira da Silva
The user when searching:
select * from usuarios where nome like '%João da Silva%';
It would not get results, as well as:
select * from usuarios where nome like '%João F. da Silva%';
I ask you, what is the best way to arrive at these results in an approximate way.
it is not a little problematic to bring everyone with 'da' in the name?
– Gabriel Oliveira
It will only bring all results with "da" if the search term is only "da". In case of being "João da Silva" will bring only results that are formed "[anything] John [anything] of [anything] Silva [anything]". The
%
works like wildcard.– Diogo Aguiar