sql >> Base de Datos >  >> RDS >> Oracle

Cómo almacenar solo el tiempo; no fecha y hora?

Puede probar el tipo de datos INTERVAL DAY TO SECOND pero no le ahorrará espacio en el disco... sin embargo, es muy adecuado para este propósito.

create table t1 (time_of_day interval day (0) to second(0));

insert into t1 values (TO_DSINTERVAL('0 23:59:59'));

select date '2009-05-13'+time_of_day
from   t1;

aunque 11 bytes.