본문 바로가기

Programming424

PL/SQL User's Guide and Reference 출처:https://forums.oracle.com/forums/thread.jspa?threadID=466812 PL/SQL User's Guide and Reference Library Product Contents Index PL/SQL Tables and User-Defined Records PL/SQL Tables User-Defined Records Knowledge is that area of ignorance that we arrange and classify.Ambrose Bierce In Chapter 2, you learned about the PL/SQL scalar datatypes, which can store only one item of data. In this chapter.. 2011. 11. 25.
오라클 누적합 구하기 SELECT SUM(VOL_EACH) OVER (ORDER BY ROWID) AS VOL , VOL_EACH , AREA , ELEV FROM ( SELECT CASE WHEN LAG(ELEV,1,0) OVER (ORDER BY ELEV ASC) = 0 THEN 0 ELSE ((AREA + (LAG(AREA,1,0) OVER (ORDER BY AREA ASC)) ) * (ELEV - (LAG(ELEV,1,0) OVER (ORDER BY ELEV ASC))) ) / 2.0 END AS VOL_EACH , AREA , ELEV , IVOL_SEQ , RSVR_CODE FROM ANL_RSVR_IVOL ) 결론은 SUM(VOL_EACH) OVER (ORDER BY ROWID) 2011. 11. 25.
일정 영역의 숫자를 row로 생성하는 오라클(Oracle) 쿼리 그동안 DICTIONARY 를 이용한 것은 정말 뻘짓이었네요..... 이것으론 1800 여개까지만 가능하다는 것을 알고 다른것을 찾다가, CONNECT BY LEVEL 을 찾았습니다!!!! 출처 : http://sewony.tistory.com/entry/%EC%9D%BC%EC%A0%95-%EC%98%81%EC%97%AD%EC%9D%98-%EC%88%AB%EC%9E%90%EB%A5%BC-row%EB%A1%9C-%EC%83%9D%EC%84%B1%ED%95%98%EB%8A%94-%EC%98%A4%EB%9D%BC%ED%81%B4Oracle-%EC%BF%BC%EB%A6%AC 간혹 일정 영역의 숫자 ( 예를 들면 1에서 10까지)를 row로 생성해야 하는 경우가 있다. 이런 경우 사용하는 쿼리 1. Pure SQ.. 2011. 11. 24.
두 시간 사이를 분단위로 구해보자. --차이값 얻기 SELECT TRUNC((TO_TIME - FROM_TIME)*24 * 60) AS DIFF FROM ( SELECT TO_DATE('201111261212', 'YYYYMMDDHH24MI') TO_TIME , TO_DATE('201111251212', 'YYYYMMDDHH24MI') FROM_TIME FROM dual ) --갯수만큼 구하기 SELECT ROWNUM NUM FROM DICTIONARY DIC , ( SELECT TRUNC((TO_TIME - FROM_TIME)*24 * 60) AS DIFF FROM ( SELECT TO_DATE('201111261212', 'YYYYMMDDHH24MI') TO_TIME , TO_DATE('201111251212', 'YYYYMMDDHH2.. 2011. 11. 24.
Easy String to DateTime, DateTime to String and Formatting 출처:http://www.codeproject.com/KB/cs/String2DateTime.aspx IntroductionIn the few years that I have been a software developer, I have work with plenty of different programming languages. The first thing that causes you headaches in all of those languages are dates and how to work with them. In this little tutorial, I would like to show you how to work with dates in C# .NET 2.0. String to DateTime .. 2011. 11. 22.
커서로 반복 작업을 할때에 -- 디버깅용 SET SERVEROUTPUT ON ; DECLARE CURSOR CUR1 IS SELECT * FROM ORGNL; BEGIN FOR CUR IN CUR1 LOOP -- 프로시저 호출 UP_AVERAGE(TRIM(CUR.CODE), SUBSTR(TRIM(CUR.DT),5,4)); END LOOP; END ; 2011. 11. 17.