How to get time string to Time in oracle sql -


i have insert time in form of string in oracle varchar2 column. when try retrieve in form of time it's not giving me right time, it's giving me date have not saved.

insert table1     (timestr) select substr(numtodsinterval(max(date1)-min(date2),'day'), 12,8)  table2 ....; // stored timestr column value: 00:00:00 

retrieve ...

select to_date(timestr,'hh24:mi:ss') table1;  

... giving 10/01/2015

you should use to_char see time

 select to_char(timestr,'hh24:mi:ss') table1;  

Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

android - Go back to previous fragment -