
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
2주차 문제
숙제: 네이버 이메일을 사용하여 앱개발 종합반을 신청한 주문의 결제수단별 주문건수 세어보기
<답변>
select payment_method,count(*) from orders
where email like '%naver.com' and course_title = '앱개발 종합반'
group by payment_method
<틀린답>
select payment_method,count(*) from orders
where course_title = '앱개발 종합반'
where email like '%naver.com'
group by payment_method
동일한 내용인데, where을 2번써서 그런지 오류가 납니다.
where문구는 반드시 1개로 들어가되, and 나 or로만 다른 조건들을 이어가야하는걸까요?
작성한 코드 및 에러 메세지
에러문구
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 'where email like '%naver.com'
group by payment_method' at line 3
