(주)카카오 쇼핑하우 판매량 데이터 분석

🌹Haeri Lee·2022년 3월 1일
0

[MySql] 업무

목록 보기
3/3

판매량 데이터 추출

ㄴ 매 월 시행
ㄴ 판매량 데이터 분석 리포트 작성

select year(cast(bu.dt as date)) as year,

           month(cast(bu.dt as date)) as month,

           bu.gcatename,

           bu.bcatename,

--        bu.mcatename,

          bu.shopid,

          sum(bu.purc_price) as purc_price

  from temp.shophow_buy_log  bu

 where dt between '2020-01-01' and '2021-09-31'

--   and bu.bcateid in ('${bcateid}')

 group by year(cast(bu.dt as date)),

                   month(cast(bu.dt as date)),

                   bu.gcatename,

                   bu.bcatename,

--                 bu.mcatename,

            bu.shopid

;

* 참고 cast 함수 
 cast(필드 as 타입) : 필드의 타입을 강제 변환
profile
안녕하세요 공부한 내용을 기록하기 위해서 시작했습니다.

0개의 댓글