Difference between Date in HH:MM
Hi,
I'm having following table, I want the difference between the time in HH:MM:SS & another output as HH:MM with seconds rounded.
CREATE TABLE "ITIP"."TOTO"
( "N1" VARCHAR2(100),
"DT1" DATE,
"DT2" DATE
)
insert into TOTO (n1, dt1, dt2)
values ('TT', to_date('25-06-2012 10:46:56', 'dd-mm-yyyy hh24:mi:ss'), to_date('25-06-2012 10:51:53', 'dd-mm-yyyy hh24:mi:ss'));
insert into TOTO (n1, dt1, dt2)
values ('TT', to_date('25-06-2012 10:51:53', 'dd-mm-yyyy hh24:mi:ss'), to_date('25-06-2012 10:51:57', 'dd-mm-yyyy hh24:mi:ss'));
insert into TOTO (n1, dt1, dt2)
values ('TT', to_date('25-06-2012 10:32:06', 'dd-mm-yyyy hh24:mi:ss'), to_date('25-06-2012 10:43:09', 'dd-mm-yyyy hh24:mi:ss'));
insert into TOTO (n1, dt1, dt2)
values ('TT', to_date('25-06-2012 10:43:09', 'dd-mm-yyyy hh24:mi:ss'), to_date('25-06-2012 10:53:09', 'dd-mm-yyyy hh24:mi:ss'));
insert into TOTO (n1, dt1, dt2)
values ('UU', to_date('25-06-2012 10:46:56', 'dd-mm-yyyy hh24:mi:ss'), to_date('25-06-2012 21:44:39', 'dd-mm-yyyy hh24:mi:ss'));
insert into TOTO (n1, dt1, dt2)
values ('UU', to_date('27-06-2012 10:51:53', 'dd-mm-yyyy hh24:mi:ss'), to_date('27-06-2012 11:46:10', 'dd-mm-yyyy hh24:mi:ss'));
insert into TOTO (n1, dt1, dt2)
values ('UU', to_date('28-06-2012 10:32:06', 'dd-mm-yyyy hh24:mi:ss'), to_date('28-06-2012 18:45:32', 'dd-mm-yyyy hh24:mi:ss'));
insert into TOTO (n1, dt1, dt2)
values ('UU', to_date('29-06-2012 14:22:13', 'dd-mm-yyyy hh24:mi:ss'), to_date('29-06-2012 17:24:20', 'dd-mm-yyyy hh24:mi:ss'));
commit;
What is the output when we subtract two dates?, Also I want the difference between the time in HH:MM:SS & another output as HH:MM with seconds rounded.
Please suggest a query for the same.
Thanks