커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
case when 구문오류인데 어느 부분이 오류인지 모르겠어요.
[왕초보] 엑셀보다 쉽고 빠른 SQL
3주차
북마크
박*경
댓글
1
추천
0
조회수
3
조회수
3
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.



아래 sql 구문이 오류로 조회가 불가한데요. 어느 부분이 문제인 걸까요?




스파르타 즉문즉답




작성한 코드 및 에러 메세지

select case when (age between 10 and 19) and gender='male' then '10대 남성',

                     when (age between 10 and 19) and gender='female' then '10대 여성',

                     when (age between 20 and 29) and gender='male' then '20대 남성',

                      when (age between 20 and 29) and gender='female' then '20대 여성' end "고객 분류",

            name,
            age,
            gender

from customers c
where age between 10 and 29


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 ',
            when (age between 10 and 19) and gender='female' then '10대 여�' at line 1


Error position:

Tip 1) </> 아이콘을 눌러 코드박스를 만들어 보세요.

Tip 2) Ctrl+A(맥의 경우 Command+A) 단축키로 코드를 한 번에 선택할 수 있어요!




취소
 공유
취소
댓글 0
댓글 알림
나의얼굴