The SQL query returns 0 data

1

I am trying to make a report but it does not filter me correctly, by using the LIKE statement even with the characters ( "% text%" ) or the equality of where clienteT='text' but in other cases if it works.

the first query does not return anything but the next 2 if they do. here the DATA

data ticket

  

The data is obtained from another system, therefore the capitals and accents are not controlled

    
asked by user75463 09.08.2018 в 18:56
source

2 answers

1

It seems that it does not recognize the blank space between 2 capitalized words ADOLFO HITLER " " therefore I tried replacing all the blank spaces with the character % and it returns me the answer, I do not know if it will have errors, but for now it works.

SELECT * FROM ticket t INNER JOIN datos d ON t.idTicket=d.idDatos WHERE d.clienteT LIKE '%ADOLFO%HITLER%';
    
answered by 09.08.2018 в 19:39
0

Do the following for your data table:

update datos
set nombre=replace(nombre,' ', '')

And ready, if you do it over your whole table, correct the digits for more spaces.

    
answered by 09.08.2018 в 19:50