I created a table with the following columns:
CREATE TABLE INDICADOR_DADOS ( ID VARCHAR2(10 CHAR) NOT NULL, DATE_START DATE NOT NULL, DATA_END DATE NOT NULL, )
Now wanted before adding, checks if there are dates between which intend to add the following query:
select COUNT(*) as count from indicador_dados where id='23' and TO_DATE(data_inicio,'yyyy/mm/dd') between to_date('2013/05/15','yyyy/mm/dd') and to_date('2013/05/16','yyyy/mm/dd')
The problem is that this query is not to be returned to 1, and because they must have in the database 05/03/2013 (date_start) and 17/05/2013(date_end). Someone can help me?
maybe duplicate: oracle-datetime-in-where-clause but not it helped me to resolve