隨筆-204  評論-90  文章-8  trackbacks-0

          以下為oracle時間運算:

          alter ?session? set ?nls_date_format = ' yyyy-mm-dd?hh24:mi:ss ' ;
          ?
          declare ?DateValue?date;?
          ?
          begin ?
          ?
          select ?sysdate? into ?DateValue? from ?dual;?
          ?dbms_output.put_line(
          ' 源時間: ' || to_char(DateValue));?
          ?dbms_output.put_line(
          ' 源時間減1天: ' || to_char(DateValue - 1 ));?
          ?dbms_output.put_line(
          ' 源時間減1天1小時: ' || to_char(DateValue - 1 - 1 / 24 ));?
          ?dbms_output.put_line(
          ' 源時間減1天1小時1分: ' || to_char(DateValue - 1 - 1 / 24 - 1 / ( 24 * 60 )));?
          ?dbms_output.put_line(
          ' 源時間減1天1小時1分1秒: ' || to_char(DateValue - 1 - 1 / 24 - 1 / ( 24 * 60 ) - 1 / ( 24 * 60 * 60 )));?
          ?
          end ;
          posted on 2006-12-05 16:08 一凡 閱讀(746) 評論(0)  編輯  收藏 所屬分類: DATABASE
          主站蜘蛛池模板: 新安县| 淄博市| 枣阳市| 屯昌县| 峨眉山市| 广平县| 墨江| 青浦区| 阿勒泰市| 文水县| 长乐市| 诏安县| 南雄市| 杂多县| 易门县| 永胜县| 湄潭县| 内黄县| 鄱阳县| 行唐县| 遵义县| 信丰县| 准格尔旗| 瓦房店市| 云林县| 宣汉县| 卢湾区| 蒙自县| 蛟河市| 简阳市| 晋中市| 英山县| 容城县| 麻江县| 本溪| 汾西县| 扬州市| 汶上县| 泌阳县| 海丰县| 望城县|