【发布时间】:2018-09-06 13:42:53
【问题描述】:
我有一个下面的table,其中包含名为Recipes 的样本数据,它充当其他2 tables 之间的junction table。
查询 -
select recipeId, IngredientId from Recipes where IngredientId in (1,31) order by recipeId
当我在SQL 上方声明execute 时,它在Output. 下方给出,这很好。
我必须在查询中进行哪些更改才能突出显示Output。
现在为什么要6,7 和21?
作为RecipeIds6、7和21是唯一具有both IngrdientIds[i.e. 1,31]的Ids
【问题讨论】:
-
RecipeID = 6 怎么样?
-
@MJH 编辑了我的问题,请检查
-
我认为这可能只是一个错字,但我想确保您没有错过问题中的某些内容。
标签: sql sql-server conditional-statements where-clause where-in