Languages
[Edit]
EN

PostgreSQL - Find rows created within the last month / months

0 points
Created by:
Wade
562

In this article, we would like to show you how to find rows created within the last months in PostgreSQL.

PostgreSQL - Find rows created within the last hour / hours
Table used in the example - HeidiSQL

Note: at the end of this article you can find database preparation SQL queries.

Query:

Edit

In the example above, the code runs on 4/24/2021, so the results are:

PostgreSQL - Find rows created within the last month / months
Results - HeidiSQL

Note:

Instead of '1 month'::interval we can write interval '1 months' - this is an older notation.

Database preparation

Edit

create_tables.sql file:

insert_data.sql file:

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

PostgreSQL - dates

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join