View Single Post
Old 08-20-2004, 08:14 PM   #5 (permalink)
magua
Tilted
 
Use EXISTS checks. Eg:

Code:
SELECT RecipeName
FROM Recipe
WHERE EXISTS (
     SELECT *
     FROM RecipeIngredient
     WHERE RecipeIngredient.RecipeID = Recipe.RecipeID
     AND RecipeIngredit.IngredientID = <Ingredient1ID>
) AND EXISTS (
     SELECT *
     FROM RecipeIngredient
     WHERE RecipeIngredient.RecipeID = Recipe.RecipeID
     AND RecipeIngredit.IngredientID = <Ingredient2ID>
) ...etc
Welshbyte's answer will return recipes that match only one ingredient.
magua is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46