0
Currently use WHERE coluna IN (1,2,3,4)
in my consultation. Only I realized that the IN
works as a kind of "OR", it generates me a small problem, because the ID
are features of a product. These features are selected in a menu, and I pass the id into that IN.
Example: Let’s say I have a menu with the following features:
MARCA
Volks 2 ITENS
COR
BRANCA 1 ITEM
AZUL 1 ITEM
If I select AZUL
, the menu is as follows :
MARCA
Volks 1 ITENS
COR
AZUL 1 ITEM
Great, after all it is exactly this type of filter that I want to do, the problem comes now, because if I click on VOLKS
, consequently I will have two filters, "COLOR: Blue" and "BRAND: Volks", and according to the menu, only one product fits these parameters, it would be like reaffirming the result.
MARCA
Volks 1 ITENS
COR
AZUL 1 ITEM
Only because of the IN, it seems that it makes a kind of "OR" in the id of the characteristics, even with two parameters the result is again:
MARCA
Volks 2 ITENS
COR
BRANCA 1 ITEM
AZUL 1 ITEM
Instead of using the IN
It would be possible to use
coluna = 1
AND
coluna = 2
AND
coluna = 3
AND
coluna = 4
Was any of the answer helpful? Don’t forget to choose one and mark it so it can be used if someone has a similar question!
– Sorack