This is a discussion on Seconds within the Oracle Miscellaneous forums, part of the Oracle Database category; --> Hi I have a test table. 1 of the columns hav time in second as follows : Seconds 10720 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| "Reiro" <ReiroGP@gmail.com> wrote in news:1143211729.506918.134210 @g10g2000cwb.googlegroups.com: > Hi > > I have a test table. 1 of the columns hav time in second as follows : > > Seconds > > 10720 > 31 > 30 > 31 > 30 > 11 > 20 > 10 > 4 > 2459 > > I want the data in a new column T in hh24:mm:ss > > plz help > > thanks in advance > > ALTER TABLE....... Are you incapable or unwilling to RTFM? http://download-west.oracle.com/docs/cd/B10501_ 01/server.920/a96540/statements_32a.htm#2054899 |
| |||
| "Reiro" <ReiroGP@gmail.com> wrote in message news:1143211729.506918.134210@g10g2000cwb.googlegr oups.com... > Hi > > I have a test table. 1 of the columns hav time in second as follows : > > Seconds > > 10720 > 31 > 30 > 31 > 30 > 11 > 20 > 10 > 4 > 2459 > > I want the data in a new column T in hh24:mm:ss > > plz help > > thanks in advance > There is a date field which includes the time of the day. Is the seconds the number of seconds since midnight? If so then alter table xyz add (mydate_col date); update xyz set mydate_col=to_date('1/1/2006','mm/dd/yyyy')+(seconds/(24*60*60)); commit; Then it would be all as of 1/1/2006. I don't know if that is what you want. Jim |
| |||
| You fail to state the version of Oracle. At least in 9i and above, there is a "interval day to seconds" datatype. Which might be closer to what you want. Unless you want to write a routine yourself to do this conversion. ORA92> create table dhms (a number, b interval day(0) to second(0)); Table created. ORA92> insert into dhms (a) values (10720); 1 row created. ORA92> insert into dhms (a) values (31); 1 row created. ORA92> update dhms set b = numtodsinterval(a, 'second'); 2 rows updated. ORA92> commit; Commit complete. ORA92> select * from dhms; A B ---------- --------------------------------------------------------------------------- 10720 +0 02:58:40 31 +0 00:00:31 Anurag |