I have two tables:
material
id | categoria | subcategoria | codigo
1 | 3 | 15 | FS-5600
2 | 0 | 16 | FA-4500
subcategory
id | descricao | id_categoria | id_produto
1 | Alasca | 3 | 2
4 | Aragon | 3 | 2
16 | A. Luiza | 7 | 1
15 | Astoria | 8 | 1
I have a search field, where the user can search for both the description and the code. As we can see, code and description are in separate tables, but when performing a given search, I need both to be returned.
How should the query be mounted?