PostgreSQL - show data of previous year + current year's week
问题 I need to make a column that would show previous year's profit till given year's week. So it would split current year in weeks and it would show what is the profit for given week. To make it more clear let say previous year profit was 1000. This year's first week profit is 100, second week's 200, thirds, week -100 (was loss) and so on. So it should look like this: week1|week2|week3| 1100 |1300 |1200 | What I tried was: SELECT CASE when f1.year = DATE_PART('year', now()) THEN f1.week END as