0
我使用VB.Net表達與Access文件,我有如下表:SQL查詢與多對多表
table Formula
id | name
-------------------
1 | formula 1
2 | formula 2
3 | formula 3
table Component
id | name
--------------------
1 | A
2 | B
3 | C
4 | D
table FormulaComponents
formula_id | component_id
-------------------------
1 | 1
1 | 2
1 | 4
2 | 1
2 | 3
2 | 4
3 | 1
3 | 2
3 | 3
因此,每個配方都有一個或多個組件。
如果我想使用例如組件A和組件D(結果:公式1,公式2)的所有公式,我將使用哪個查詢?我試着用十字交叉的東西,但它似乎不能在VB中工作...
謝謝!
你想都只有A和d或公式,可能有其他的項目呢? – 2010-12-22 15:05:09
其他項目也是如此。 – 2010-12-22 15:31:34