I'm having a question about how to return records from a table that have all the values entered in the IN
operator using JOIN
in another table.
I have a table of flags, colors and the other making the relation between the two (flags and colors);
flag table - > bandeira_id, NomeBandeira
table color - > cor_id, colorName
table bandeira_cor - > id, flag_id, cor_id
Assuming that color 1 is Blue and color 2 is White, how do I get flags that have Blue and White colors and not just White or Blue only.
I tried to use the IN
operator but I brought the flags that have the color Blue or White.
SELECT nomeBandeira FROM bandeira INNER JOIN cor WHERE cor.cor_id IN (1,2)