[英]How to sum all rating column values where recipe_id is distinct
To be more specific I have a table with recipes. 更具体地说,我有一张包含食谱的表格。 In another table I keep ratings associated with these recipes.
在另一个表格中,我保留与这些食谱相关的评分。 Each rating has an unique id, the second column is the recipe's id, the third column is the rating (from 1-5).
每个等级都有一个唯一的ID,第二列是配方的ID,第三列是等级(从1-5开始)。
Expected result is the recipe_id, where all ratings associated with that recipe_id are the highest. 预期的结果是“ recipe_id”,其中与该“ recipe_id”关联的所有评分均为最高。
I hope you understand, I have no idea how to approach such query properly. 希望您理解,我不知道如何正确处理此类查询。
Hopefully I've posted my question properly, it's my first one. 希望我已经正确地发布了我的问题,这是我的第一个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.