我需要根据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)