0

select day_only(createdDate) createdonDate, count(createdDate) numCreated from account group by day_only(createdDate) order by day_only(createdDate) desc

这个 sql 返回结果计数基于天。但我希望基于月份的结果计数。任何方式来实现这个soql。

4

1 回答 1

2

使用 CALENDAR_MONTH 函数:

select CALENDAR_MONTH (createdDate) createdonDate, count(ID) numCreated from account group by CALENDAR_MONTH (createdDate) order by CALENDAR_MONTH (createdDate) desc
于 2013-05-21T05:20:43.480 回答