SCAP 교육2일차 실습코드 정리 및 이론 요약
- 최초 등록일
- 2020.05.30
- 최종 저작일
- 2018.07
- 8페이지/ 한컴오피스
- 가격 1,500원
목차
없음
본문내용
CHAPTER 4
4.1 Inner Join
proc sql;
create table work.order_cust as
select O.customer_id , product_id, order_date, total_retail_price , country, gender "성별" /* ANSI 표준 */
,case country
when "US" then total_retail_price * .3
when "AU" then total_retail_price *.2
else total_retail_price *.1
end as tax label = '국가별 세금' format = comma10.1
/* SAS 방법 ( format은 ANSI표준이 적용되지 않는다 */
from orion.order_fact O , orion.customer C
/* 쿼리가 진행되는 동안에만 임시로 별명이 부여된다 */
where O.customer_id = C.customer_id ; /* 해주지 않으면 두 개의 테이블로 만들어 질 수 있는 모든 경우가 나타난다. ( 카디션 곱) */
quit;
/* 또 다른 Inner Join표현 */
proc sql;
create table work.order_cust as
select O.customer_id , product_id, order_date, total_retail_price , country, gender "성별" /* ANSI 표준 */
,case country
when "US" then total_retail_price * .3
when "AU" then total_retail_price *.2
else total_retail_price *.1
end as tax label = '국가별 세금' format = comma10.1
from orion.order_fact as o inner join orion.customer C
on o.customer_id = c.customer_id ;
참고 자료
없음