Database

오라클 임시 테이블 with ... as

steloflute 2016. 7. 29. 22:40


with TEST as (
select '1' A, '사과' B, '대구' C, '2000' D from dual union all
select '1' A, '사과' B, '대구' C, '3000' D from dual union all
select '1' A, '사과' B, '광주' C, '1000' D from dual union all
select '1' A, '사과' B, '광주' C, '4000' D from dual union all
select '2' A, '인삼' B, '파주' C, '1000' D from dual union all
select '2' A, '인삼' B, '파주' C, '2000' D from dual union all
select '2' A, '인삼' B, '파주' C, '3000' D from dual union all
select '2' A, '인삼' B, '금산' C, '2000' D from dual
)
select * from test;