db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel J Debrunner <...@apache.org>
Subject Re: Question - Second function
Date Tue, 03 Oct 2006 18:33:08 GMT


> > --- "Bernt M. Johnsen" <Bernt.Johnsen@Sun.COM>
> wrote:
> > 
> >> ij> create table ts (t timestamp);
> >> 0 rows inserted/updated/deleted
> >> ij> insert into ts values (current_timestamp);
> >> 1 row inserted/updated/deleted
> >> ij> select t, second(t), second(cast(t as time)),
> >> second('1999-09-09 09:09:09.999') from ts;
> >> T                         |2                    
> |3 
> >>         |4
> >>
> >
>
-------------------------------------------------------------------------
> >> 2006-10-03 09:49:58.306   |58.306               
> |58
> >>         |9
> >>
> >> 1 row selected
> >> ij>
> >>
> >> But as you see, there's an anomality here, since
> the
> >> timestamp string (col 4)
> >> does not return 9.999 as I would have expected.
> > 

According to the docs, the second function returns a
large integer between 0 and 59, which means column 2
is the anomaly.

Dan.



Mime
View raw message