
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
정답에 있는 SQL 문은 아래와 같습니다.
select c1.title, c2.week, count(*) as cnt from courses c1
inner join checkins c2 on c1.course_id = c2.course_id
inner join orders o on c2.user_id = o.user_id
where o.created_at >= '2020-08-01'
group by c1.title, c2.week
order by c1.title, c2.week
그런데 c2에도 created_at 필드가 있어서 출력을 바꿔서 해보면 다른 결과가 나오는데요.
c2와 o에 있는 created_at 은 다른 것인지 궁금합니다.
SELECT c1.title, c2.week, count(*) as cnt from courses c1
inner join checkins c2 on c1.course_id = c2.course_id
inner join orders o on c2.user_id = o.user_id
where c2.created_at >= '2020-08-01'
group by c1.title, c2.week
order by c1.title, c2.week
