+------------+--------------------+----------+-------------+
| id_product | name | id_brand | id_category |
+------------+--------------------+----------+-------------+
| 1 | Nokia E55 | 120 | 1 |
| 2 | Nokia E75 (Red) | 101 | 1 |
| 3 | Nokia N86 | 105 | 2 |
| 4 | Nokia 6700 Classic | 110 | 2 |
| 5 | Nokia 6260 Slide | 120 | 1 |
+------------+--------------------+----------+-------------+
我想做的是,我有以下数据
id_category = 1,2
id_brand = 110,105
现在我想要以下产品
Nokia 6700 Classic
Nokia N86
只要
因为id_category 1 .......中没有品牌(110,105)
最佳答案
我相信您正在寻找:
WHERE id_category IN (1,2) AND id_brand IN (110,105)