PG数据库,时间戳转换
将毫秒/秒转成格式化后的时间
select to_char(to_timestamp(time),'yyyy-MM-dd HH24-MI-SS') as time from tablename;
#统计每个月的记录数
select to_char(to_timestamp(time),'yyyy-MM') as time ,count(1) from tablename group by time;
版权声明:本文为weixin_40434637原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。