D
D
Denis Lvov2020-10-29 13:41:48
PostgreSQL
Denis Lvov, 2020-10-29 13:41:48

How to calculate the value for each month, provided that the data is collected for 90 days?

There is a table: date_name, name

The need is as follows:
Output count(name) by month, but the condition is that name is considered in the interval from "end of the month" to "end of the month - 90 days"

Example:
September - count(name) where date_name between date' 07/02/2020' and date'09/30/2020'
and so on for all months.
those. As I understand it, this is a nested query, but I still don’t understand how to organize it.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question