My table is like this on Postgres, note that all days start by 01, there is only 1 entry a month+year
SELECT * FROM "fis_historico_receita"
+----+------------+---------------+
| id | data | receita_bruta |
+----+------------+---------------+
| 1 | 2010-02-01 | 100000.0 |
| 2 | 2010-01-01 | 100000.0 |
| 3 | 2009-12-01 | 100000.0 |
| 4 | 2009-11-01 | 100000.0 |
| 5 | 2009-10-01 | 100000.0 |
| 6 | 2009-09-01 | 100000.0 |
| 7 | 2009-08-01 | 100000.0 |
| 8 | 2009-07-01 | 100000.0 |
| 9 | 2009-06-01 | 100000.0 |
| 10 | 2009-05-01 | 100000.0 |
| 11 | 2009-04-01 | 100000.0 |
| 12 | 2009-03-01 | 100000.0 |
| 13 | 2009-02-01 | 100000.0 |
| 14 | 2009-01-01 | 100000.0 |
| 15 | 2008-12-01 | 100000.0 |
+----+------------+---------------+
What I want is to find 12 months starting right from before the current.
I tried this:
select *
from fis_historico_receita
where data in interval '1 year'
I really would like an answer using Interval, +1 goes for everyone that runs on Postgres