作者f8663 (WYCM)
看板Database
標題[SQL ] 系統日期與表單時間相減如何只保留天數
時間Wed Sep 24 13:48:37 2014
資料庫名稱:Oracle SQL Developer
資料庫版本:Version 2.1.1.64
內容/問題描述:如標題 我語法如下
SELECT sysdate- gt_cretime from r_actbdmpass;
出現的結果是
1722 13:45:56.0
我要如何只保留天數 即1722天呢
感謝各位
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 122.146.229.136
※ 文章網址: http://www.ptt.cc/bbs/Database/M.1411537719.A.5A8.html
※ 編輯: f8663 (122.146.229.136), 09/24/2014 13:58:29
推 GoalBased: format? 我不知道甲骨文是怎樣取格式的 09/24 15:30
→ GoalBased: 但從格式上下手就對了 09/24 15:30
→ iFEELing: trunc ? 09/25 00:15
→ joedenkidd: 用substr去取你要的值看看吧! 09/25 12:42