
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
강의 속 퀴즈 내용과는 무관하나,
아래 예문 쿼리 실행 시 4번째 줄에서
alias로 값을 입력하면 오류가 뜨는데
alias로는 select로 출력할 값을 입력할 수 없는지 궁금합니다.
select c.course_id,
COUNT(DISTINCT(c.user_id)) as cnt_checkin,
COUNT(DISTINCT(o.user_id)) as cnt_tot,
cnt_checkin/cnt_tot as ratio
from checkins c
inner join orders o on c.course_id = o.course_id
group by c.course_id
select c.course_id,
COUNT(DISTINCT(c.user_id)) as cnt_checkin,
COUNT(DISTINCT(o.user_id)) as cnt_tot,
COUNT(DISTINCT(c.user_id))/COUNT(DISTINCT(o.user_id)) as ratio
from checkins c
inner join orders o on c.course_id = o.course_id
group by c.course_id

