커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
4-4강 with절 연습하기 -> SQL Error [1146] [42S02]: Table 'sparta.table1' doesn't exist
[왕초보] 엑셀보다 쉬운, SQL
4주차
북마크
조*희
댓글
2
추천
0
조회수
29
조회수
29
답변 완료
안녕하세요, 강의를 보고 똑같이 따라 적은 것 같은데 제목과 같은 에러가 뜨는데요.
구글링을 해보니 상당히 어렵고 복잡한 해결책들이 나와서... 혹시나해서 이곳에 먼저 여쭈어봅니다.


with table1 as (
	select course_id, count(distinct(user_id)) as cnt_checkins from checkins
	group by course_id
), table2 as (
	select course_id, count(*) as cnt_total from orders
	group by course_id
)


select c.title, 
	   a.cnt_checkins, 
	   b.cnt_total,
	   (a.cnt_checkins/b.cnt_total) as ratio
from table1 a
inner join table2 b on a.course_id = b.course_id
inner join courses c on a.course_id = c.course_id
취소
 공유
취소
댓글 0
댓글 알림
나의얼굴