그룹단위로 지정건수만큼 레코드를 취득한다.(2건씩)
select
id, pw, row_number
from (
select
id, pw, row_number() over (partition by sex order by id) as row_number
from member
)
where row_number <= 2;
그룹단위로 레코드의 건수를 취득한다.
select
id, sex, count(*) over (partition by sex) as count
from member
'오라클' 카테고리의 다른 글
| 정규표현식 치환(regexp_replace) (0) | 2012.05.31 |
|---|---|
| 소계 계산(rollup) (0) | 2012.05.31 |
| 오라클 쇼핑몰 기본 DDL (0) | 2012.05.27 |
| MySQL file (0) | 2012.05.04 |
| 테이블 스페이스와 유저 생성(Create tablespace and user) (0) | 2011.11.05 |