본문 바로가기

db

[Oracle] 11g R2 : IGNORE_ROW_ON_DUPKEY_INDEX Hint IGNORE_ROW_ON_DUPKEY_INDEX Hint When a statement of the form INSERT INTO target subquery runs, a unique key for some rows to be inserted might collide with existing rows. Suppose that your application must ignore such collisions and insert the rows that do not collide with existing rows. Before Oracle Database 11g Release 2, you had to write a PL/SQL program which, in a block with a NULL handler.. 더보기
[Oracle] 11g R2 : LISTAGG Function Advanced Aggregates for Analysis This section illustrates the following advanced analytic aggregate functions: LISTAGG Function The LISTAGG function orders data within each group based on the ORDER BY clause and then concatenates the values of the measure column. Its syntax is as follows:LISTAGG ( [, ) WITHIN GROUP (ORDER BY ) expr can be a column, constant, bind variable, or an expression invol.. 더보기
[Oracle] explain plan을 활용한 인덱스 생성 예상시간 explain plan for create index orders_ix01 on orders (customer_id, order_mode) ; select * from table(dbms_xplan.display) ; Plan hash value: 4214405511 ------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop | ------------------------------------------------------------------------------- | 0 | CREAT.. 더보기
[Oracle] 테이블별 레코드 건수 구하기 SELECT TABLE_NAME , NUM_ROWS , TO_NUMBER( DBMS.XMLGEN('SELECT COUNT(*) FROM ' || TABLE_NAME).EXTRACT('.//text()') ) AS NUM_ROWS2 FROM USER_TABLES WHERE 1=1 ; 출처 : 오라클클럽 URL : http://www.oracleclub.com/article/55486 더보기
[Oracle] 컬럼상 끝 문자 삭제 SELECT RTRIM('123,456,789,', ',') FROM DUAL ; 더보기