sequelize group by day

use function date_trunc

 

 

sql:

 

SELECT date_trunc('day',"createdAt") FROM "IAPRecords" WHERE "IAPRecords"."UserId" = 1 GROUP BY date_trunc('day',"createdAt");

 

 

https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC 

 

 

 

 

转载于:https://www.cnblogs.com/ybleeho/p/9930877.html

评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符 “速评一下”
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页