커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
03. [실습] User Segmentation 와 조건별 수수료를 Subquery 로 결합해보기
엑셀보다 쉽고 빠른 SQL v0
4주차
북마크
고*리
댓글
1
추천
0
조회수
11
조회수
11
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.


select restaurant_name,

price_per_plate*ratio_of_add "수수료"

그냥 복붙하라고 하셔서 했는데 빨간색으로 표시되는데 상관없는 건가요??




스파르타 즉문즉답




작성한 코드 및 에러 메세지

select restaurant_name,

price_per_plate*ratio_of_add "수수료"

from

(

select restaurant_name,

case when price_per_plate<5000 then 0.005

when price_per_plate between 5000 and 19999 then 0.01

when price_per_plate between 20000 and 29999 then 0.02

else 0.03 end ratio_of_add,

price_per_plate

from

(

select restaurant_name, avg(price/quantity) price_per_plate

from food_orders

group by 1

)a

)b




취소
 공유
취소
댓글 0
댓글 알림
나의얼굴