0
Hello, I have 2 fields of type DATE, as the snippet below:
  ...hr_inicio                 DATE         NOT NULL,
     hr_fim                    DATE         NOT NULL, ...
And I am in need of consulting these fields using only the values relating to time HH24:mm:ss, example: 10:00:00
In this way I would like to carry out my select by passing the time, minute and second as parameters of the Where clause. To bring all dates that have the start time 10:00:00 and end time 12:00:00 as shown in the image below.
I am 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 wasn’t efficient.
