Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一张表(除其他事项外)评分在 0 到 4 之间以及它的发送日期。
我想知道可以为两个日期之间的每个日期选择我们在某个日期获得的平均评分。
是的,它使用了所有明显的 SQL 运算符:
select date, avg(rating) avg_rating from table where date between :start and :end group by date
当然,这是非常基本的 SQL。
SELECT AVG(rating) AS rating, rating_date FROM ratings GROUP BY rating_date;