0
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 certain search, I need both to be returned.
How to be mounted to query?
But Voce wants to return what? Product? Description of subcategory?
– Danillo Victtor
@Danillovictor, description and code.
– lucasbento
the code column is referencing which column of the table subcategory?
– Danillo Victtor
@Danillovictor, we can continue this discussion via chat?
– lucasbento
Your question is unclear, what should I search for? what should I return for a particular survey?
– Pedro H.
Peter, I wish to return code and description. "As we can see, code and description are in separate tables, but when performing a certain search, I need both to be returned." @Pedroh.
– lucasbento
You can use Inner Join, it is a common feature for these cases.
– Danillo Victtor
the error is saying that there is no code column in the table subcategory. So I am saying, the source column of the material table is referencing which column of the table subcategory?
– Danillo Victtor