成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

DB2數(shù)據(jù)庫中時間函總結(jié)

數(shù)據(jù)庫
本文將為您詳細介紹DB2數(shù)據(jù)庫中時間函數(shù)的分類介紹,供您參考,希望能對您有所幫助。

本文將為您詳細介紹DB2數(shù)據(jù)庫中時間函數(shù)的分類介紹,供您參考,希望能對您有所幫助。

DB2時間函數(shù)簡單總結(jié):

代碼
--獲取當前日期:

select current date from sysibm.sysdummy1;
values current date;

--獲取當前日期
select current time from sysibm.sysdummy1;
values current time;
--獲取當前時間戳
select current timestamp from sysibm.sysdummy1;
values current timestamp;

--要使當前時間或當前時間戳記調(diào)整到 GMT/CUT,則把當前的時間或時間戳記減去當前時區(qū)寄存器:

values current time -current timezone;
values current timestamp -current timezone;

--獲取當前年份

values year(current timestamp);

--獲取當前月
values month(current timestamp);#p#

--獲取當前日
values day(current timestamp);

--獲取當前時
values hour(current timestamp);

--獲取分鐘
values minute(current timestamp);

--獲取秒
values second(current timestamp);

--獲取毫秒
values microsecond(current timestamp);

--從時間戳記單獨抽取出日期和時間

values date(current timestamp);
values VARCHAR_FORMAT(current TIMESTAMP,"yyyy-mm-dd");
values char(current date);
values time(current timestamp);

--執(zhí)行日期和時間的計算

values current date+1 year;   
values current date+3 years+2 months +15 days;
values current time +5 hours -3 minutes +10 seconds;

--計算兩個日期之間的天數(shù)#p#

values days(current date)- days(date("2010-02-20"));

--時間和日期換成字符串

values char(current date);
values char(current time);

--要將字符串轉(zhuǎn)換成日期或時間值

values timestamp("2010-03-09-22.43.00.000000");
values timestamp("2010-03-09 22:44:36");
values date("2010-03-09");
values date("03/09/2010");
values time("22:45:27");
values time("22.45.27");

--計算兩個時間戳記之間的時差:

--秒的小數(shù)部分為單位
values timestampdiff(1,char(current timestamp - timestamp("2010-01-01-00.00.00")));
--秒為單位
values timestampdiff(2,char(current timestamp - timestamp("2010-01-01-00.00.00")));
--分為單位
values timestampdiff(4,char(current timestamp - timestamp("2010-01-01-00.00.00")));
--小時為單位
values timestampdiff(8,char(current timestamp - timestamp("2010-01-01-00.00.00")));
--天為單位
values timestampdiff(16,char(current timestamp - timestamp("2010-01-01-00.00.00")));
--周為單位
values timestampdiff(32,char(current timestamp - timestamp("2010-01-01-00.00.00")));
--月為單位
values timestampdiff(64,char(current timestamp - timestamp("2010-01-01-00.00.00")));
--季度為單位
values timestampdiff(128,char(current timestamp - timestamp("2010-01-01-00.00.00")));
--年為單位
values timestampdiff(256,char(current timestamp - timestamp("2010-01-01-00.00.00")));

責任編輯:段燃 來源: 百維信息科技
相關推薦

2011-08-18 19:10:27

DB2數(shù)據(jù)庫命令

2011-03-15 11:19:45

DB2數(shù)據(jù)庫catalog

2010-09-01 10:17:14

DB2日志

2010-08-25 10:50:48

DB2數(shù)據(jù)庫

2011-03-11 16:02:03

DB2數(shù)據(jù)庫安裝

2010-09-01 15:23:59

DB2字段類型

2010-08-26 16:15:25

DB2數(shù)據(jù)庫管理

2010-11-01 11:30:41

DB2數(shù)據(jù)庫權(quán)限

2010-09-30 11:49:21

DB2數(shù)據(jù)庫權(quán)限

2010-11-03 16:21:18

DB2數(shù)據(jù)庫授權(quán)

2009-07-06 17:34:26

遠程復制DB2

2010-11-01 14:19:20

DB2字符串

2010-07-28 11:05:57

DB2數(shù)據(jù)庫

2010-08-26 16:34:12

DB2Excel讀取

2010-08-31 13:06:49

DB2數(shù)據(jù)庫

2010-11-03 16:32:10

DB2創(chuàng)建數(shù)據(jù)庫

2010-11-02 11:49:18

SQL SERVER連

2010-08-31 11:26:59

DB2數(shù)據(jù)庫

2010-08-11 08:39:57

DB2 數(shù)據(jù)庫

2010-08-17 17:29:06

DB2性能優(yōu)化
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 久久91精品国产一区二区 | 国产精品久久久久久 | 久久久国产一区二区三区四区小说 | 亚洲一区在线播放 | 国产午夜精品一区二区 | 99在线免费观看视频 | 毛片免费观看视频 | 综合色导航| 天天干com| 国产精品综合色区在线观看 | 日韩精品一区二区三区在线播放 | 久久99久久| 草久在线 | 一区二区在线不卡 | yiren22 亚洲综合 | av中文字幕在线观看 | 久久久国产亚洲精品 | 99精品免费久久久久久日本 | 狠狠爱综合网 | 一区二区三区视频免费观看 | 黄网站色大毛片 | 日韩中文字幕在线观看 | 欧美精品久久久 | 精品一二三 | 在线国产视频 | 久久在线 | 国产精品18久久久 | 精产国产伦理一二三区 | 黄色一级电影免费观看 | 欧美精品一区免费 | 天堂中文av | 久久精品毛片 | 欧美国产日韩在线观看 | 日韩成人一区二区 | 国产精品中文字幕在线播放 | 午夜电影网站 | 成人在线免费电影 | 久久精品99| 欧美理伦片在线播放 | 91精品在线看 | 国产亚洲精品精品国产亚洲综合 |