PostgreSQL实现按年、月、日、周、时、分、秒的分组统计 PostgreSQL实现按年、月、日、周、时、分、秒的分组统计按年查询 select to_char(date::DATE, 'YYYY') as year,sum(shares) as