自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Oracle時(shí)間實(shí)際應(yīng)用代碼的示例

數(shù)據(jù)庫(kù) Oracle
我們今天主要要討論的是Oracle時(shí)間的實(shí)際應(yīng)用,以及Oracle時(shí)間的實(shí)際應(yīng)用的相關(guān)代碼的描述,以下就是正文的主要內(nèi)容的介紹。

以下的文章主要是通過相關(guān)的代碼的方式來引出Oracle時(shí)間的實(shí)際應(yīng)用,前兩天我在相關(guān)的網(wǎng)站看到關(guān)于Oracle時(shí)間的實(shí)際應(yīng)用的資料,如果你對(duì)其相關(guān)的實(shí)際操作有興趣的話,你就可以對(duì)以下的文章點(diǎn)擊觀看了。

  1. select to_char(sysdate,''hh:mi:ss'') TIME from all_objects  

注意:第一條記錄的TIME 與最后一行是一樣的

可以建立一個(gè)函數(shù)來處理這個(gè)問題

  1. create or replace function sys_date return date is   
  2. begin   
  3. return sysdate;   
  4. end;   
  5. select to_char(sys_date,''hh:mi:ss'') from all_objects;   

Oracle時(shí)間的應(yīng)用中獲得小時(shí)數(shù)

 

  1. SELECT EXTRACT(HOUR FROM TIMESTAMP ''2001-02-16 2:38:40'') from offer   
  2. SQL> select sysdate ,to_char(sysdate,''hh'') from dual;   
  3. SYSDATE TO_CHAR(SYSDATE,''HH'')   
  4. 2003-10-13 19:35:21 07   
  5. SQL> select sysdate ,to_char(sysdate,''hh24'') from dual;   
  6. SYSDATE TO_CHAR(SYSDATE,''HH24'')   
  7. 2003-10-13 19:35:21 19   

 

獲取年月日與此類似

Oracle時(shí)間的應(yīng)用中年月日的處理

  1. select older_date,   
  2. newer_date,   
  3. years,   
  4. months,   
  5. abs(   
  6. trunc(   
  7. newer_date-   
  8. add_months( older_date,years*12+months )   
  9. )   
  10. ) days   
  11. from ( select   
  12. trunc(months_between( newer_date, older_date )/12) YEARS,   
  13. mod(trunc(months_between( newer_date, older_date )),   
  14. 12 ) MONTHS,   
  15. newer_date,   
  16. older_date   
  17. from ( select hiredate older_date,   
  18. add_months(hiredate,rownum)+rownum newer_date   
  19. from emp )   
  20. )  

以上的相關(guān)內(nèi)容就是對(duì)Oracle時(shí)間的應(yīng)用的相關(guān)項(xiàng)目的介紹,望你能有所收獲。

文章出自: http://www.programbbs.com/doc/class10-3.htm

【編輯推薦】

  1. 對(duì)Oracle SQL相同語(yǔ)句的解析
  2. 何謂Oracle標(biāo)準(zhǔn)化?
  3. Oracle數(shù)據(jù)庫(kù)和DB2取前10條記錄的實(shí)際對(duì)比
  4. Oracle數(shù)據(jù)庫(kù)與DM的強(qiáng)制訪問的不同之處
  5. Oracle的實(shí)體-Oracle關(guān)系模型
責(zé)任編輯:佚名 來源: programbbs
相關(guān)推薦

2010-04-12 12:30:44

Oracle 安裝腳本

2010-04-13 14:25:24

Oracle問題解決

2010-04-19 11:37:20

Oracle數(shù)據(jù)庫(kù)

2010-04-12 09:26:52

Oracle查詢分頁(yè)

2010-06-02 17:46:54

MySQL 查詢緩存

2010-05-18 16:29:44

MySQL修改表

2010-04-09 16:26:53

Oracle join

2010-05-17 09:25:34

MySql 編碼設(shè)置

2010-04-27 09:28:55

綁定變量

2010-04-15 17:08:20

Oracle存儲(chǔ)過程

2010-04-23 11:15:43

Oracle創(chuàng)建

2010-05-10 18:38:08

Oracle分頁(yè)語(yǔ)句

2010-03-30 14:32:38

Oracle Date

2010-03-23 13:30:36

Python VIM

2010-04-08 18:33:46

Oracle VARR

2010-05-10 13:33:11

Oracle存儲(chǔ)過程

2010-04-09 18:15:47

Oracle 字符串

2021-07-19 15:12:21

Python編程語(yǔ)言

2010-05-04 15:15:39

Oracle分頁(yè)查詢

2010-04-29 09:16:16

Oracle密碼過期處
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)