Week of year of a timestamp using derby/JavaDB

2019-09-08 05:41发布

问题:

I need to know the week of year of a timestamp using Derby/JavaDB. And to make it worse I have to extract it from a parameter not a column. Don't ask why but that should be a minor problem.

On DB2 I say someting like

VALUES WEEK_ISO(?)

But how do I get the same result with Derby aka JavaDB?

回答1:

Thanks Bryan, your Link was very helpful.

http://therealdanvega.com/blog/2010/02/17/creating-apache-derby-custom-functions-part-2

It seems there is no week function in derby but it is very easy to program such a function yourself. Especially when you use it from Java.



标签: sql derby javadb