以下查询为每次出现 recipecomments.RecipeID 带来一条记录,我只想为每个 recipeID 带来一条记录,按 recipeid 分组似乎不起作用
SELECT recipecomments.RecipeID
,recipecomments.CommentID
,recipes.RecipeID
,recipes.Name
,recipes.CategoryID
,recipes.RatingTotal
,recipes.ImageMed
FROM recipecomments
JOIN recipes ON recipecomments.RecipeID = recipes.RecipeID
ORDER BY recipecomments.CommentID