'How to query objects created in current month but at least one year ago when creation date is a timestamp

I have to build a SQL query to find objects which were created in current month (e.g. March) but at least one year ago. So I expect to fetch objects created in 03.2021, 03.2020, 03.2019 etc. Creation date is stored as Timestamp.

Is it possible to build such a query, or I have to fetch all objects created at least one year ago and check for their creation month in a loop (because I'm querying from Java)? SQL scheme change is not allowed.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source