我有这张桌子:
Recipe = (idR, recipeTitle, prepText, cuisineType, mealType)
Ingredient = (idI, ingrDesc)
RecipIngr = (idR*, idI*)
我正在尝试显示包含蜂蜜或芥末成分的 idR 和食谱标题。这是我的查询
select idr, recipetitle
from recipe
where idr IN (select idr from recpingr where idi =
(select distinct idr from ingredient where ingrdesc like '%honey%'))
INTERSECT
select idr, recipetitle
from recipe
where idr IN (select idr from recpingr where idi =
(select distinct idr from ingredient where ingrdesc like '%mustard%'))
ORDER BY idr;
由于某种原因,这不会显示正确的数据,我不知道我做错了什么。有什么帮助吗?我的查询有问题吗?