我有这三个表:如何选择符合连接表中定义条件的记录?
products TABLE:
id:integer
name:string
features TABLE:
id:integer
name:string
features_products TABLE:
product_id:integer
feature_id:integer
的features_products TABLE
告诉我,其特点有每个产品。例如:
product_id feature_id
1 3
1 5
3 4
告诉我的产品1具有特征3和5和产品3具有特征4,另外,产物2(如果存在)不具有的特征。
我的问题是,我怎样才能SELECT
所有的产品从产品TABLE具有确定的功能?例如,SELECT products which have features 3 AND 5
,或SELECT products which have feature 2
features_products我编辑。谢谢。 – 2010-07-05 18:59:07