如何根据今天在Postgresql中的日期提取前N年的YTD数据?

时间:2016-11-29 15:19:33

标签: sql postgresql

我需要根据CURRENT_DATE()提取报告,我需要此报告显示前N年的数据。 我应该如何在Postgresql中编写查询?

示例表:User - user_id|created_date 预期产出:Year|Count_of_Acquired_Users_YTD 例如:2014|100,000 (this is the number of acquired users from 2014-01-01 to current_date of 2014 (2014-11-29)

0 个答案:

没有答案