字段
ID Name 积分 分销商ID 创建时间请问如何查询 时间在一个区间范围内的不同分销商ID的积分汇总select GetScore.DistributorID,sum(GetScore.Score) as GetTotal from GetScore
group by GetScore.DistributorID order by GetTotal这条语句不可行!
请高手回答我 谢谢谢谢!
ID Name 积分 分销商ID 创建时间请问如何查询 时间在一个区间范围内的不同分销商ID的积分汇总select GetScore.DistributorID,sum(GetScore.Score) as GetTotal from GetScore
group by GetScore.DistributorID order by GetTotal这条语句不可行!
请高手回答我 谢谢谢谢!
select DistributorID,sum(Score) as GetTotal from GetScore where CreateTime between '2011-07-01 12:20:20' and '2011-08-01 12:20:20' group by DistributorID order by GetTotal
select DistributorID,sum(score) as totalScore from GetScore where createdate between '2011-08-02 00:00:00' and '2011-08-03 00:00:00' group by DistributorID order by GetTotal输出结果就是下面这样的:DistributorID totalScore
2 6
1 9