zOs/SQL/TST

SELECT  HEX(left(V2, 20)), v2 FROM                                      00000114
    A540769.twk600a001                                                  00000214
    fetch first 5 rows only                                             00000314
;;                                                                      00000414
select current timestamp, hex(current timestamp)                        00001013
     from sysibm.sysDummy1                                              00001113
;;;                                                                     00001213
with t0 (a, e) as                                                       00001303
(                                                                       00001403
select                                                                  00001503
  '2011-09-13-09.10.11.121314', '2011-09-13-09.10.12.778899'            00001603
    from sysibm.sysDummy1                                               00001703
union all select                                                        00001803
  '2011-09-13-09.10.11.121314', '2011-09-13-10.11.13.010203'            00001903
    from sysibm.sysDummy1                                               00002003
union all select                                                        00002107
  '2011-08-13-09.10.11.121314', '2011-09-13-10.11.13.010203'            00002207
    from sysibm.sysDummy1                                               00002307
union all select                                                        00002412
  '2010-12-31-23.48.59.987651', '2011-01-01-02.13.14.567899'            00002512
    from sysibm.sysDummy1                                               00002612
), t (a, e) as                                                          00002703
(                                                                       00002804
select timestamp(a), timestamp(e)                                       00002903
    from t0                                                             00003003
)                                                                       00003103
select                                                                  00003205
    (days(e) - days(a)) * 86400                                         00003305
    + midnight_seconds(e) - midnight_seconds(a)                         00003405
    + 0.000001 * (microsecond(e) - microsecond(a))                      00003506
    , t.*                                                               00004005
    from t                                                              00005005
;                                                                       00006005
select timestamp(x'c100000000000000'),                                  00010002
       timestamp(x'C767BA9E5EA00000')                                   00011002
    from sysibm.sysDummy1                                               00020000
select days('2011-09-13'), days('2010-09-13'), days('2012-09-13')       00030012
    from sysibm.sysDummy1                                               00040012
;;,                                                                     00050012