Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / SQL PLUS Session Environment
 

Format interval type column

SQL>  create table myTable(   2        break_time   interval day(1) to second(2)   3  ); Table created. SQL> SQL> insert into myTable (break_time )   2  values (TIMESTAMP '2001-09-03 12:47:00.000000' - TIMESTAMP '2001-09-03 13:13:00.000000' ); 1 row created. SQL> SQL> insert into myTable ( break_time )   2  values ( TIMESTAMP '2001-09-03 13:35:00.000000' - TIMESTAMP '2001-09-03 13:39:00.000000' ); 1 row created. SQL> SQL> insert into myTable ( break_time )   2  values (TIMESTAMP '2001-09-03 16:30:00.000000' - TIMESTAMP '2001-09-03 17:00:00.000000' ); 1 row created. SQL> SQL> insert into myTable ( break_time )   2  values ( TIMESTAMP '2001-09-03 17:00:00.000000' - TIMESTAMP '2001-09-03 17:30:00.000000' ); 1 row created. SQL> SQL> column break_time format a30 SQL> SQL> select * from myTable; BREAK_TIME ------------------------------ -0 00:26:00.00 -0 00:04:00.00 -0 00:30:00.00 4 rows selected. SQL> SQL> drop table myTable; Table dropped.