查询每个用户指定月份最后一天的收益

Posted 落叶子

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了查询每个用户指定月份最后一天的收益相关的知识,希望对你有一定的参考价值。

select o.AgentId ,o.Date,o.profit from agentprofit as o join (select a.AgentId,MAX(Date) as max_Date from agentprofit as a GROUP BY a.AgentId) as t on o.AgentId=t.AgentId and
o.Date=t.max_Date GROUP BY o.AgentId,o.profit

以上是关于查询每个用户指定月份最后一天的收益的主要内容,如果未能解决你的问题,请参考以下文章