oracle over partition by

 SELECT SHRI_CD,
    SHRI_SIYO_BANK_EDANO,
    SHRI_IN_CD,
    SHRI_BANK_CD,
    SHRI_KOZA_NO,
    SHRI_Z70MJ_MEISHO,
    SHRI_CO_CD
    FROM
    (SELECT SHRI_CD,
    SHRI_SIYO_BANK_EDANO,
    SHRI_IN_CD,
    SHRI_BANK_CD,
    SHRI_KOZA_NO,
    SHRI_Z70MJ_MEISHO,
    SHRI_CO_CD,
    ROWNUM ROW_NUM,
    MIN(ROWNUM) OVER (PARTITION BY SHRI_CD ORDER BY SHRI_SIYO_BANK_EDANO) MIN_ROW_NUM
    FROM
    C1592MS_EINRY_SHRI
    )
    WHERE ROW_NUM = MIN_ROW_NUM

 

select * from (select mutest1.*, rownum as rowNo from mutest1 )x where  rowNo> 2 and   rownum < 3;rownum<= right,rownum cursor,返回结果后 cursor重置。

 

重复数据,表消除连接,exists,in (),=()

 

 

你可能感兴趣的:(oracle,pl/sql)