我面临的问题是,我想加入这两个查询。
SELECT recipes.RecipeID ,recipes.Name,recipes.ImageThumb,recipes.RatingTotal,
count(ratings.RecipeID) AS trates
FROM recipes
JOIN ratings
ON ratings.RecipeID = recipes.RecipeID
WHERE recipes.Name LIKE '%ade%'
ORDER BY Name;
此查询无法按预期工作,当有多个结果时,它会带来 1 个结果,并且 trats 是所有结果的总和,而不仅仅是那个特定的 RecipeID