Hello, I have 2 DATE fields, depending on the snippet below:
...hr_inicio DATE NOT NULL,
hr_fim DATE NOT NULL, ...
And I need to query these fields using only the values for the HH24: mm: ss time, example: 10:00:00
In this way I would like to accomplish my select passing as parameters of the where clause the hour, minute and second. To bring all the dates that have the start time 10:00:00 and 12:00 noon as shown in the image below.
I'm using Oracle SQL
PS: I've tried using the following way:
SELECT * FROM TABELA WHERE
HR_INICIO = TO_DATE('10:00:00','hh24:mi:ss') AND
HR_FIM = TO_DATE('12:00:00','hh24:mi:ss')
But it was not efficient.