You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Nicolas Dufour <ni...@neometsys.fr> on 2005/09/29 23:06:35 UTC
Operators & functions
Hi
After successfully login to my base with user&pwd (thanks for the help
:) ), I have a little problem...
I try to convert queries used in a SQL Server to be used on Derby, and
the problem is : what kind of operators and functions i can use for that ?
I have looked at the reference pdf file, and i found nothing to compute
the difference between two timestamps for example, or to convert a
timestamp in an integer (in sql only, in java its trivial).
Thanks
Nicolas
Re: Operators & functions
Posted by "Jean T. Anderson" <jt...@bristowhill.com>.
Nicolas Dufour wrote:
> ...
> I have looked at the reference pdf file, and i found nothing to compute
> the difference between two timestamps for example, or to convert a
> timestamp in an integer (in sql only, in java its trivial).
timestampdiff computes the difference between two timestamps. Examples
are on this page:
http://db.apache.org/derby/docs/10.1/ref/rrefjdbc88908.html
timestampdiff uses JDBC escape syntax; for example, in ij:
ij> values CURRENT_TIMESTAMP;
1
--------------------------
2005-09-29 14:30:38.061
1 row selected
ij> values {fn TIMESTAMPDIFF(SQL_TSI_WEEK, CURRENT_TIMESTAMP,
timestamp('2001-01-01-12.00.00.000000'))} ;
1
-----------
-247
1 row selected
I hope this helps,
-jean