isn't it not just the "next months with data" data in this case?
select *
from vt_tst
where col2/100 = (
select min(col2) / 100
from vt_tst
where col2 >= (add_months(cast('2012-03-01' as date),1)
- extract(day from add_months(cast('2012-03-01' as date),1))
) + 1
)
↧