Oracle - SQL - Retornar registros entre incio del ano passado y el proximo

Solución:

select * from <TABLA> where <CAMPO> between to_date('0101' || to_char(trunc(sysdate, 'YEAR')-1, 'YYYY'), 'DDMMYYYY') AND to_date('3112' || to_char(trunc(sysdate, 'YEAR')+1, 'YYYY'), 'DDMMYYYY')

Comments

Popular posts from this blog

Hibernate - HibernateException: createQuery is not valid without active transaction