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