飛舞的幻想

          常用鏈接

          統計

          Google Adsense

          Zanox FWHX

          花個明白

          最新評論

          DB2 時間轉換

          create function ts_fmt(TS timestamp, fmt varchar(20)) returns varchar(50) return with tmp (dd,mm,yyyy,hh,mi,ss,nnnnnn) as ( select substr( digits (day(TS)),9), substr( digits (month(TS)),9) , rtrim(char(year(TS))) , substr( digits (hour(TS)),9), substr( digits (minute(TS)),9), substr( digits (second(TS)),9), rtrim(char(microsecond(TS))) from sysibm.sysdummy1 ) select case fmt when 'yyyymmdd' then yyyy || mm || dd when 'mm/dd/yyyy' then mm || '/' || dd || '/' || yyyy when 'yyyy/dd/mm hh:mi:ss' then yyyy || '/' || mm || '/' || dd || ' ' || hh || ':' || mi || ':' || ss when 'nnnnnn' then nnnnnn else 'date format ' || coalesce(fmt,' ') || ' not recognized.' end from tmp 使用例句: update t_attachment as a set a.attach_path=(select '/'||rtrim(char(apply_com_id))||'/'||rtrim(char(ts_fmt(apply_date,'yyyymmdd')))||'/' from t_rmbs_claim as c where a.claim_id=c.claim_id)||rtrim(a.attach_path) where exists (select 1 from t_rmbs_claim as tc where tc.claim_id=a.claim_id);

          posted on 2010-03-05 18:18 飛舞的幻想 閱讀(272) 評論(0)  編輯  收藏 所屬分類: 初見POI


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 淄博市| 张家口市| 达孜县| 铅山县| 定州市| 平凉市| 襄樊市| 米泉市| 丰县| 自贡市| 屯门区| 漾濞| 高阳县| 文安县| 搜索| 紫云| 时尚| 通辽市| 宝坻区| 哈巴河县| 青龙| 林芝县| 柳州市| 南溪县| 扬中市| 遵化市| 湘潭县| 六安市| 榆中县| 偃师市| 南和县| 浦县| 油尖旺区| 禹州市| 商洛市| 屯门区| 河北区| 宿松县| 东明县| 遂宁市| 尼玛县|