码迷,mamicode.com
首页 > 数据库 > 详细

PostgreSQL按年月日分组

时间:2017-03-29 20:48:49      阅读:279      评论:0      收藏:0      [点我收藏+]

标签:tab   pos   group   ...   post   rom   time   style   分组   

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按年月日分组

标签:tab   pos   group   ...   post   rom   time   style   分组   

原文地址:http://www.cnblogs.com/Ryan2012/p/6641649.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!