我有类似以下的记录
fruit day
apple 1/1/1990
apple 1/2/1990
apple 1/3/1990
plum 1/1/1990
orange 1/1/1990
orange 1/2/1990
orange 1/3/1990
我想保持一个项目为每天假设项目将增加1每天运行总数。例如
fruit day count
apple 1/1/1990 1
apple 1/2/1990 2
apple 1/3/1990 3
plum 1/1/1990 1
orange 1/1/1990 1
orange 1/2/1990 2
2条答案
按热度按时间ulydmbyx1#
你可以用开窗的
COUNT
:dbfiddle演示
u0njafvf2#
你也可以使用
subquery
: