I have a query with dates for the last two years. I want to get data dynamically for the last 4 months.
That is if today 04/01/2021 I want to get data from 01/09/2020 up today inclusive.
The problem with my query is that I get data between 04/09/2020 up today, i.e. 4 months not including a full first month.
PostgreSQL
SELECT Category,
Product,
Sales,
Date
FROM Table
WHERE Date>= now() - INTERVAL '4 months'
What I need to change in my query ??
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…