首页 > 代码库 > PostgreSQL按年月日分组

PostgreSQL按年月日分组

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

PostgreSQL按年月日分组