Hi all, and thanks ahead to the helpers.
for several hours im trying to overcome on an error im stuck with..
that's the issue:
i have 3 table:
1. Recipes
2. RegisteredUsers
3. RecipeRating
the searching value would be Recipes.RecipeN ame.
i would like to retrieve the following:
1. Recipes.*
2. RegisteredUsers .Username
3. AVG(Rating) , SUM(Rating)
that's the query i've tried to run:
however, i keep getting the same annoying error: The multi-part identifier "Rate.rateI d" could not be bound.
i tried several variety of changes but nothing much helped.
for several hours im trying to overcome on an error im stuck with..
that's the issue:
i have 3 table:
1. Recipes
2. RegisteredUsers
3. RecipeRating
the searching value would be Recipes.RecipeN ame.
i would like to retrieve the following:
1. Recipes.*
2. RegisteredUsers .Username
3. AVG(Rating) , SUM(Rating)
that's the query i've tried to run:
Code:
SELECT Recipes.Id, Recipes.RecipeName, Recipes.DateAdded, Recipes.Show, Recipes.Category, Recipes.ShortDescription, Recipes.PrepareTime_Secs,
Recipes.Level, RegisteredUsers.Username AS Uploader, AVG(Rate.Rating) AS r1, SUM(Rate.Rating) AS r2
FROM Recipes INNER JOIN
RegisteredUsers ON Recipes.Uploader = RegisteredUsers.Id INNER JOIN
(SELECT Id AS rateId, Rating
FROM RecipeRating
GROUP BY rateId
) AS Rate ON Recipes.Id =Rate.RecipeId
WHERE (Recipes.RecipeName = @input)
i tried several variety of changes but nothing much helped.
Comment