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 

 

 

 

 

posted @ 2018-11-08 18:34  ybleeho  阅读(721)  评论(0编辑  收藏  举报