I currently use WHERE coluna IN (1,2,3,4)
in my query. Only I noticed that IN
works as a sort of "OR", this gives me a small problem because ID
are characteristics of a product. These features are selected from a menu, and I step 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 looks like this:
MARCA
Volks 1 ITENS
COR
AZUL 1 ITEM
Well, this is exactly the type of filter I want to do, the problem comes now, because if I click on VOLKS
, I will therefore have two filters, "COLOR: Blue" and "MARK: 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
But because of the IN, it looks like it does a type of "OR" in the id of the features, even with two parameters the result returns to:
MARCA
Volks 2 ITENS
COR
BRANCA 1 ITEM
AZUL 1 ITEM
Instead of using IN
It would be possible to use
coluna = 1
AND
coluna = 2
AND
coluna = 3
AND
coluna = 4