【发布时间】:2011-04-24 05:20:08
【问题描述】:
所以基本上我将 3 个表连接在一起。主表是菜谱,然后是配料表,然后是配料表。
所以我需要一个查询,其中只有不含鸡肉的食谱。我遇到的问题是,因为当我使用 where != 时食谱有很多成分,这只是去除了该肉的成分,但留下了其他成分.....我如何解释多种成分。
select Recipe.name as "No chicken" from Recipe inner join IngredientList on Recipe.recipeId=IngredientList.recipeId inner join Ingredients on IngredientList.IngredientId=Ingredients.ingredientId where type!="chcicken" group by Recipe.name;
【问题讨论】:
-
另外,如果我只想要鸡肉......所以 type="chicken" 并且只产生鸡肉食谱?
标签: mysql