CREATE TABLE experiment
(experiment_id NUMBER(9),
experiment_desc VARCHAR2(80),
experiment_start TIMESTAMP,
experiment_duration INTERVAL DAY(1) TO SECOND(4)
);
Table created.
INSERT INTO experiment
VALUES (
1, 'Busted urban myth', '01-JUN-2006 02:00:00 PM',
INTERVAL '1 2:31:15.1250' DAY(1) TO SECOND(4)
);
1 row created.
col experiment_desc format a40
col experiment_start format a30
col experiment_duration format a20
SELECT * FROM experiment;
EXPERIMENT_ID EXPERIMENT_DESC
EXPERIMENT_START EXPERIMENT_DURATION
1 Busted urban myth 01-JUN-06 02.00.00.000000 PM +1 02:31:15.1250
-- Now compute the experiment's ending time
SELECT experiment_id, experiment_start,
experiment_start + experiment_durationexperiment_end
FROM experiment;
EXPERIMENT_ID EXPERIMENT_START
EXPERIMENT_END
1 01-JUN-06 02.00.00.000000 PM 02-JUN-06 04.31.15.125000000 PM |