I'm getting closer. It shows Butter as being a substitute for Butter, for example. I need to exclude that obviously.... I'll figure it out shortly.

Thanks for the help!

Edit: Got it!

SELECT a.ingredientname AS Original_Ingredient, b.ingredientname AS Possible_Substitute
FROM ingredient_all AS a, ingredient_all AS b,
ingredient_similar AS x, ingredient_similar AS y,
recipe_ingredient AS z
WHERE a.IngredientID=z.IngredientID
AND a.IngredientID=x.IngredientID
AND x.IngSimID=y.IngSimID
AND y.IngredientID=b.IngredientID
AND z.RecipeID=1
AND (y.IngredientID>x.IngredientID OR y.IngredientID<x.IngredientID)
ORDER BY Original_Ingredient ASC
-Biscuits


Edited by Biscuitsjam (08/02/2003 18:28)