개발일지/DataBase
Union
Union Select를 두 번 할 게 아니라, 한번에 모아서 보고싶을 때 ex) 7월의 자료 select '7월', 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 8월의 자료 select '8월', c1.title, c2.week, count(*) as cnt from courses c1 inner join checkins c2..