1
我在Access 2010中编写了一个sql查询,并得到一条错误消息,说我选择的字段在多个关系中使用,所以我需要从一个表中选择。我以为我有正确的代码,明确告诉它哪个表可以选择,但我仍然得到这个错误。编码时出错(多重关系)SQL
这是我的代码:
SELECT I.ingredientID, ingredientTypeCode, ingredientName, amount, unitCode
FROM Ingredient AS I
INNER JOIN BatchIngredient AS B ON I.ingredientID=B.ingredientID
ORDER BY ingredientID;
如果不指定I.ingredientID说,它将从成分拉ingredientID而忽略BatchIngredient?
这两个表中是否存在更多字段名称? – William
Just ingredientID包含在两个表中。 – Jonathan