【发布时间】:2014-03-12 04:43:44
【问题描述】:
我有 3 个表,TableA、TableB 和 TableAB(多对多表)。
参见下面的 TableAB 示例:
TableAB
id_attribute | id_product_attribute
14 | 18
14 | 19
16 | 10
16 | 12
16 | 16
16 | 18
16 | 20
16 | 22
16 | 24
16 | 26
在这个表中,我有来自 TableA 的 id_attribute 和来自 TableB 的 id_product_attribute。
如果我想找出同时具有 id_attributes 14 和 16 的 id_product_attribute,我应该怎么做?
基本上,我有 id_attributes 的组合,我正在寻找包含所有这些的特定 id_product_attribute。
在上面的示例中,只有 product_attribute 18 具有属性 14 和 16。我的第一个查询将找出所有属性。我现在遇到的这个问题是从这个表中确定它是哪个产品属性。
谢谢。
【问题讨论】: