Select 在SQL中使用Where语句
如果ingrDesc为“孜然”,如何选择idR和RecipeTle 这就是我所拥有的:Select 在SQL中使用Where语句,select,join,where,Select,Join,Where,如果ingrDesc为“孜然”,如何选择idR和RecipeTle 这就是我所拥有的: 配方=(idR、RecipeTle、prepText、菜系类型、mealType) 成分=(idI、ingrDesc) RecipIngr=(idR*,idI*) 在不知道表结构的情况下,任何猜测都有点随机。这里有一个随机猜测。我猜那个配料有一个外键,和配方有关。我叫那把钥匙 SELECT idR, recipeTitle FROM Recipe r INNER JOIN Ingredient i ON
- 配方=(idR、RecipeTle、prepText、菜系类型、mealType)
- 成分=(idI、ingrDesc)
- RecipIngr=(idR*,idI*)
SELECT idR, recipeTitle
FROM Recipe r
INNER JOIN Ingredient i
ON r.idR = i.RecipeId
WHERE ingrDesc='cumin'
SELECT idR, recipeTitle
FROM Recipe r
INNER JOIN Ingredient i
ON r.idR = i.RecipeId
WHERE ingrDesc='cumin'