오라클(Oracle) 피벗(pivot) 샘플 (행을 열로, row를 col로)

By | 11월 19, 2016

 

select * from (
      select "API명", "응답기관", "성공건수", "실패건수",
      from (
       ... 대단한 쿼리.. 중략 ...
      )
)
PIVOT (SUM("성공건수") AS 성공, SUM("실패건수") AS 실패 FOR "API명" IN ('계좌등록' AS "계좌등록", '잔액조회' AS "잔액조회", '입금이체' AS "입금이체"))

 

 

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments