I need to make a comparison between two tables to find out if the address of table A is present in the address of table B.
Example: Table A has a record with the ENDERECO field with the value "STREET FULANO DE TAL 67 401" and in table B, the ENDERECO field has "STREET FULANO DE TAL, AP 401, 67". That is, it contains everything I seek, but in a different order. SQL
SELECT * FROM TABELA_B WHERE ENDERECO LIKE '%RUA%FULANO%DE%TAL%67%401%'
does not return anything, because SELECT looks for parameters in the reported order.
Now my question: Is there a way to search for all parameters, regardless of the order they were entered?