
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
1.
group by를 하지 않으면, [앱개발종합반] 값만 나옵니다.
group by를 하지 않으면 title 종류가 2개더라도 상위값 하나만 도출되나요?
<제가 쓴 답안>
select c.title, count(*) as cnt from checkins h
inner join courses c on h.course_id = c.course_id
<답안>
select c.title, count(*) as checkin_count from checkins h
inner join courses c
on h.course_id = c.course_id
group by h.title
2.
* 있으면 아래와 같이 에러가 뜹니다. 왜그럴까요? (에러메세지 참고)
*를 붙일때와 붙이지 않을때의 차이점은 뭔가요?
<제가 쓴 답안>
select u.user_id, u.name, u.email, p.point * from point_users p
inner join users u on p.user_id = u.user_id
order by p.point desc
작성한 코드 및 에러 메세지
SQL Error [1064] [42000]: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from point_users p
inner join users u on p.user_id = u.user_id
order by p.poin' at line 1
