일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
- ibsheet
- PLSQL
- tomcat
- oracle
- node.js
- MFC
- rowspan
- jsr 296
- phonegap
- 가우스
- MySQL
- jQuery
- Google Map
- WebLogic
- 전자정부프레임워크
- Eclipse
- Android
- 선택적조인
- PHP
- iBATIS
- appspresso
- dock
- swingx
- Struts
- JSON
- GPS
- Spring
- sencha touch
- Ajax
- JDOM
- Today
- Total
목록Developement/DataBase (109)
Where The Streets Have No Name
http://www.dbguide.net/know/know102001.jsp?mode=view&divcateno=32&divcateno_=30&pg=6&idx=2717 http://www.dbguide.net/know/know102001.jsp?mode=view&divcateno=32&divcateno_=30&pg=5&idx=2774
SELECT ... FROM aaa A, bbb B WHERE A.ID = B.ID AND A.TYPE = '0' AND B.NODE_TYPE = 'C'; 먼저 회원님의 이해를 돕기 위해서 위의 예를 통해 Hash Join에 대해 말씀 드리겠습니다. A Table과 B Table이 각각의 상수 조건을 가지고 각각의 join 대상이 되는 집합을 구성하는 데, A Table은 A.TYPE = '0' 조건만을 가지고 Join을 위한 중간 집합을 만든다. 만약 A.TYPE을 선행 컬럼으로 하는 Index가 있다면 해당 Index를 사용하여 Access하고 없다면 Full Index Scan 또는 Full Table Scan을 통해 중간 집합을 구성합니다. B Table은 B.NODE_TYPE = 'C' 조건만을..
새로운 MODEL 절 Jonathan Gennick 새로운 MODEL 절을 사용하여 스프레드시트 계산을 데이타베이스로 가져옵니다. 계산된 열값을 반환하는 쿼리를 작성 중일 때 이 계산의 입력으로 여러 행의 값이 필요하다면 어떻게 하시겠습니까? 실제로 이 문제는 상당히 흔한 문제입니다. 대개 이 문제의 해결 방법은 자체 결합(self-join)과 하위 쿼리를 이해하기 어려운 방식으로 조합하여 사용하는 것입니다. Oracle Database 10g에서는 새로운 접근 방식을 사용할 수 있습니다. SELECT 문의 새로운 MODEL 절을 사용하여 관계형 데이타를 다차원 배열로 간주할 수 있으며 이 다차원 배열에 스프레드시트 형식의 계산을 사용할 수 있습니다. 이 결과 더 쉽게 쿼리를 개발하고 이해하며 수정할 수..
전화table : phone_num, startdate, enddate, ratetype 요금table : ratetype, startdate, enddate, rate select a.phone_num 전화번호, greatest(a.startdate,b.startdate) startdate, least(a.enddate,b.enddate) enddate, a.ratetype, b.rate from 전화 a, 요금 b where a.ratetype = b.ratetype and b.startdate a.startdate and a.phone_num = '1111111'
1. 적용원리 . 임의의 숫자의 곱을 숫자의 합 형태로 변경한다. - e^(ln X) = X - e^(ln X + ln Y) = e^(ln (X * Y)) = X * Y 2. 샘플 CREATE TABLE test( id number, col1 number); INSERT INTO test VALUES(1, 5); INSERT INTO test VALUES(2, 10); INSERT INTO test VALUES(3, 7); INSERT INTO test VALUES(4, 10); SQL> SELECT id, col1, EXP(m) multiply FROM ( SELECT id, col1, SUM(LN(col1)) OVER (ORDER BY id) m FROM test ); ID COL1 MULTIPLY ..
BYPASS_RECURSIVE_CHECK BYPASS_UJVC CACHE_CB CACHE_TEMP_TABLE CIV_GB COLLECTIONS_GET_REFS CUBE_GB CURSOR_SHARING_EXACT DEREF_NO_REWRITE DML_UPDATE DOMAIN_INDEX_NO_SORT DOMAIN_INDEX_SORT DYNAMIC_SAMPLING DYNAMIC_SAMPLING_EST_CDN EXPAND_GSET_TO_UNION FORCE_SAMPLE_BLOCK GBY_CONC_ROLLUP GLOBAL_TABLE_HINTS HWM_BROKERED IGNORE_ON_CLAUSE IGNORE_WHERE_CLAUSE INDEX_RRS INDEX_SS INDEX_SS_ASC INDEX_SS_DESC ..
현재달의 날짜전부 select trunc(sysdate,'month') + n from(select rownum-1 n from dual connect by level
SQL PLAN을 튜닝하다보면, 조인순서를 조정할 필요가 있다. 일반적으로는 주어진 조인조건에 따라 오라클 옵티마이저에 의해 조인순서가 정해진다. 또는 FROM절의 테이블순서를 조정한후 ORDERED 힌트를 쓰거나 LEADING 힌트를 써서 최초로 드라이빙되는 테이블만을 지정하는 방법을 쓰거나 INDEX 힌트로 간접적으로 조인순서를 조정키도 한다. ORDERED 힌트는 전체 테이블 조인순서가 고정되므로 CBO환경에서는 옵티마이저의 유연성이 떨어질 수 있고, 적용력이 강력한 힌트다. 가급적 다른 힌트를 이용해서 SQL을 튜닝하는 것이 권장된다. 어쨋든 ORDERED 힌트를 이용하여 FROM 절 테이블 순서대로 조인되도록 조정한 경우, 이중 HASH JOIN으로 조인된 테이블의 순서를 바꿔야 할 경우가 있을..
-- 9i 일경우 Inner View로 작성 select num from (select level num from dual connect by level
1. 10분에 한번씩 실행하는 경우 sysdate + 1/24/6 또는 sysdate + 1/144 -> 1/24 (1시간-60분) / 6 : 10분 단위 1/144 : 24*6 으로 나누어도 같은 의미가 된다. 2. 1분에 한번으로 지정하는 경우 sysdate + 1/24/60 또는 sysdate + 1/1440 3. 매일 새벽 2시로 지정하는 경우 trunc(sysdate) + 1 + 2/24 -> 다음날 새벽 2시를 지정함. 4. 매일 밤 11시로 지정하는 경우 trunc(sysdate) + 23/24 -> 오늘 밤 11시를 지정했음
1. Oracle8i 이상 버전을 사용할 경우에는 세션이 끝날 때까지만 존재하는 테이블을 만들 수 있습니다. Oracle8i New Features 중 하나인 TEMPORARY TABLE을 이용하시면 됩니다. 테이블을 만드는 명령문은 아래와 같습니다. CREATE GLOBAL TEMPORARY TABLE (...컬럼 및 제약조건 정의 등의 문법은 일반 테이블과 동일합니다...) [ON COMMIT DELETE ROWS | ON COMMIT PRESERVE ROWS]; ON COMMIT DELETE ROWS 절을 이용하여 생성한 테이블은 트랜잭션 끝까지, ON COMMIT PRESERVE ROWS 절을 사용하여 만든 테이블은 세션 끝까지만 데이터가 저장됩니다. 그리고 해당 트랜잭션, 또는 세션 동안 이 테..
http://dba-services.berkeley.edu/docs/oracle/manual-10gR2/server.102/b14211/hintsref.htm#i27644
select next_day(last_day(to_date('20060710')) - 7, '금요일') from dual;
http://www.dbguide.net/dbqa/dbqa120001.jsp?mode=view&pg=14&idx=539
방법1) SELECT x.date_val FROM ( select TRUNC(to_date('20060701'),'YYYY')+ROWNUM -1 as date_val, TO_CHAR(TRUNC(to_date('20060701'),'YYYY')+ROWNUM -1,'YYYYMM') as year_month, TO_CHAR(TRUNC(to_date('200607010'),'YYYY')+ROWNUM -1,'DD') as day, ROWNUM FROM all_objects WHERE TRUNC(to_date('20060701'),'YYYY')+ROWNUM -1 < ADD_MONTHS(TRUNC(to_date('20060701'),'YYYY'),12) ) x where year_month = to_number(to..
CREATE OR REPLACE procedure pr_pv_send_mail ( p_from in varchar2, p_from_name in varchar2, p_to in varchar2, p_to_name in varchar2, p_subject in varchar2, p_body in varchar2 ) is v_connection UTL_SMTP.CONNECTION; mesg VARCHAR2( 6000 ) := ''; begin --smtp setting v_connection := UTL_SMTP.OPEN_CONNECTION('156.147.113.6',25); UTL_SMTP.HELO(v_connection,'156.147.113.6'); UTL_SMTP.MAIL(v_connection,p..
DBMS_JOB PACKAGE의 사용 방법과 예제 ================================== Unix의 cron과 같이 오라클에서도 일정한 시점, 또는 간격으로 반복해서 job을 수행시킬 수 있다. DBMS_JOB package를 이용하여 수행시킬 수 있는데, 이것을 위해서는 SNP background process가 start되어 있어야 한다. 다음의 parameter를 init.ora file에 설정한 후 oracle을 startup하면 SNP process가 올라온다. job_queue_processes = 1-> 이 파라미터는 snp process를 몇 개 띄울지를 결정한다. default=0job_queue_interval = 60-> 이 파라미터는 snp process가 깨..
'where not in' 사용 시 정말 유의할 점!!! 초보팁 : http://www.chobotip.com/phpBB2/viewtopic.php?t=433 Number컬럼을 하나 가진 Table 1과 Table 2를 만들어 보겠습니다. 코드: Create table Table1 (A number); Insert into Table1 Values(1); Insert into Table1 Values(2); Create table Table2 (A number); Insert into Table2 Values(1); Insert into Table2 Values(Null); 다음에 'not in'을 이용한 SQL을 만들어 보겠습니다. 코드: Select A from Table1 Where A not in..
http://dev.mysql.com/tech-resources/articles/hierarchical-data.html mysql