행위

"오라클 시간차이"의 두 판 사이의 차이

DB CAFE

(새 문서: <div style=" border:solid 1px #cccccc; background: -webkit-linear-gradient(white, #ececec); For Safari 5.1 to 6.0: background: -o-linear-gradient(white, #ececec); /* For Oper...)
 
(오라클 시간 차이 구하기)
 
(같은 사용자의 중간 판 3개는 보이지 않습니다)
1번째 줄: 1번째 줄:
 +
== 오라클 시간 차이 구하기 ==
 +
<source lang=sql>
 +
SELECT
  
<div style="
+
      TRUNC(EndDate - StartDate) as "일",
border:solid 1px #cccccc;
+
        TRUNC(((EndDate - StartDate) - TRUNC(EndDate - StartDate)) * 24) as "시간",
background: -webkit-linear-gradient(white, #ececec); /* For Safari 5.1 to 6.0 */
+
        FLOOR(((((EndDate - StartDate) -TRUNC(EndDate - StartDate)) * 24)
background: -o-linear-gradient(white, #ececec); /* For Opera 11.1 to 12.0 */
+
        - TRUNC(((EndDate - StartDate)-TRUNC(EndDate - StartDate)) * 24)) * 60) as "분"
background: -moz-linear-gradient(white, #ececec); /* For Firefox 3.6 to 15 */
+
     
background: linear-gradient(white, #ececec); /* Standard syntax */
+
  FROM (             
padding: 1px 10px 10px 0px;
+
        SELECT TO_DATE('20090101 12:30','yyyymmdd hh24:mi') as StartDate, -- 시작일
  line-height:100%;
+
                      TO_DATE('20091001 17:20','yyyymmdd hh24:mi') as EndDate    -- 종료일
color:#489cdf;
+
            FROM DUAL
font-weight:700;
+
        )
font-family: Tahoma, 맑은 고딕,돋움체;
+
</source>
font-size:{{{폰트크기|12}}}pt;
+
[[category:oracle]]
"> <font color="{{글자색깔|#489cdf}}"><i class="material-icons icon-image-preview"
 
style="
 
    display: inline-block;
 
    transform: translate(-10%, 20%);
 
    "
 
>&nbsp;{{{아이콘이름|notifications_active}}}</i></font>{{{제목|스타일리쉬 타이틀바}}}
 
 
 
</div>
 

2021년 5월 10일 (월) 17:40 기준 최신판

thumb_up 추천메뉴 바로가기


오라클 시간 차이 구하기[편집]

SELECT 

       TRUNC(EndDate - StartDate) as "일", 
         TRUNC(((EndDate - StartDate) - TRUNC(EndDate - StartDate)) * 24) as "시간", 
         FLOOR(((((EndDate - StartDate) -TRUNC(EndDate - StartDate)) * 24) 
         - TRUNC(((EndDate - StartDate)-TRUNC(EndDate - StartDate)) * 24)) * 60) as "분"
       
  FROM (               
        SELECT TO_DATE('20090101 12:30','yyyymmdd hh24:mi') as StartDate,  -- 시작일
                       TO_DATE('20091001 17:20','yyyymmdd hh24:mi') as EndDate    -- 종료일
             FROM DUAL
        )