选择day_only(createdDate)createdonDate, count(createdDate)numCreated 从帐户 group by day_only(createdDate) 按day_only(createdDate)desc
排序此soql返回结果计数基于日。 但我希望结果计数基于month.A实现这个soql的方法。
答案 0 :(得分:2)
使用CALENDAR_MONTH功能:
select CALENDAR_MONTH (createdDate) createdonDate, count(ID) numCreated from account group by CALENDAR_MONTH (createdDate) order by CALENDAR_MONTH (createdDate) desc