有表如下:
代码语言:javascript复制ID EventNo Coin Uid FlowNo
1 600041 30 1 1531238400000000000
2 600041 30 2 1531238400000000000
...
统计一些数据, 分别统计 每个EventNo 在某段FlowNo内的: Coin数, 记录数, 本Event完成的Uid数(同个Uid同个EventNo只记一次)
sql:
代码语言:javascript复制select EventNo, Count(ID),Sum(Coin),count(distinct(Uid)) from CoinFlow where FlowNo>1531238400000000000 and FlowNo<1531324800000000000 group by EventNo;