aaaaaaaa
WITH t(type, name, code) AS ( SELECT '과일', '사과', '0' FROM dual UNION ALL SELECT '과일', '레몬', '1' FROM dual UNION ALL SELECT '과일', '포도', '2' FROM dual UNION ALL SELECT '과일', '참외', '3' FROM dual UNION ALL SELECT '채소', '오이', '0' FROM dual UNION ALL SELECT '채소', '당근', '1' FROM dual UNION ALL SELECT '채소', '호박', '2' FROM dual ) SELECT type , SUBSTR(XMLAgg(XMLElement(x, ',', name) ORDER BY code).Extract..
더보기
시간계산 쿼리
SELECT BASE_DT,PRJT_NM,JOB_ID,SQNC_NO,STRN_DTTM,END_DTTM,EXCT_DTTM,trunc( mod( (END_DTTM-STRN_DTTM)*24, 24 ) )|| --요거슨 HHtrunc( mod( (END_DTTM-STRN_DTTM)*24*60, 60 ) )|| --요거슨 MItrunc( mod( (END_DTTM-STRN_DTTM)*24*60*60, 60 ) ) T --요거슨SS,mod((END_DTTM-STRN_DTTM)*24,60) FROM TDWCMSETLJLOGIWHERE BASE_DT ='20130318' AND JOB_ID like '%TOA%'order by 3
더보기