티스토리 뷰
with temp as( select '1' idx , '10' dept , '20170703' as lastm ,'기타' as data_etc from dual union all select '2' idx , '20' dept , '20170704' as lastm ,'정상' as data_etc from dual union all select '2' idx , '20' dept , '20170705' as lastm ,'비정상' as data_etc from dual union all select '3' idx , '40' dept , '20170703' as lastm ,'기타' as data_etc from dual union all select '3' idx , '40' dept , '20170701' as lastm ,'기타' as data_etc from dual union all select '4' idx , '60' dept , '20170703' as lastm ,'기타' as data_etc from dual union all select '4' idx , '60' dept , '20170702' as lastm ,'기타' as data_etc from dual ) select * from ( select a.* , row_number() over( partition by idx, dept order by lastm desc) rnk from temp a ) where rnk = 1 order by idx |
'DEV > DB' 카테고리의 다른 글
ibatis remapResults (0) | 2016.10.28 |
---|---|
index 리빌드 (0) | 2015.11.26 |
PrepareStatment(#)와 Statment($) (0) | 2015.11.26 |
- Total
- Today
- Yesterday
- 무료
- 조회
- 데스트톱
- 펄
- 배민문방구
- Oracle
- Java
- 배달의민족
- 지니어스
- 해외
- 삼슉이
- 직링
- phython
- 수리영역
- font
- 배민
- 개발폰트
- 인텔리 제이
- 바다
- 오라클
- 정답
- 오피스
- 쿠폰
- 할인
- 여행
- 시즌2
- 신혼
- 베네수엘라
- 유휴시간
- 직구
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |