PostgreSQL按年月日分组(关键词:extract time as Year/Month/Day)

 

Select 

EXTRACT(year from cast(joindate as timestamp)) as Year,

EXTRACT(month from cast(joindate as timestamp)) as Month,

EXTRACT(day from cast(joindate as timestamp)) as Day,

......

From Table

Group by Year,Month,Day

posted @ 2019-08-13 14:38  双间  阅读(898)  评论(0编辑  收藏  举报