with t (t) as 00001000
( 00002000
select current timestamp from sysibm.sysDummy1 00003000
union all select '2014-06-17-00.00.00' from sysibm.sysDummy1 00004000
) 00005000
, u (a, b) as 00006000
( 00007000
select t, t - 1 minute from t 00010000
union all select t, t + 2 hour from t 00020000
union all select t, t - 3 day from t 00030000
union all select t, t + 4 month from t 00040006
) 00050000
select a - b minus 00060006
, timestampDiff(2, char(a-b)) "secs" 00061007
, timestampDiff(16, char(a-b)) "days" 00062007
, timestampDiff(256, char(a-b)) "years" 00062107
, a, b 00063006
from u 00070000