The solution for aggregation of timestamp durations is to use timestampdiff , a built - in udf user defined function that is included with db2 udb , as shown in the following example 解決持續時間的聚合問題可以使用timestampdiff ,如下面的樣本實例中所顯示,它是使用db2 udb實現的嵌入式udf (用戶定義的功能) 。