M
M
McMike2017-03-17 07:15:27
PostgreSQL
McMike, 2017-03-17 07:15:27

How to make a query not from a table?

You need to select dates with an interval of a month, with a condition, for example, for the last 6 months or, for example, for 2015-2016.
Can this be done at all if there is no data table? You just need to select dates with some condition, it is not clear what to write in from and what to apply the condition to

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Shelemetiev, 2017-03-17
@McMike

select 
current_date - interval '1 month' * s
from 
generate_series(0, 5) s

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question