Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果 ingrDesc 是“孜然”,我如何选择 idR 和 recipeTitle 这就是我所拥有的:
RecipIngr = (idR*, idI*)
SELECT idR, recipeTitle FROM Recipe JOIN Ingredient WHERE ingrDesc='cumin'
在不知道您的表结构的情况下,任何猜测都会有些随机。这是一个随机的猜测。我猜成分有一个与食谱相关的外键。我将调用该键RecipeId。
SELECT idR, recipeTitle FROM Recipe r INNER JOIN Ingredient i ON r.idR = i.RecipeId WHERE ingrDesc='cumin'