커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
개인적으로 만든 디비버 질문
엑셀보다 쉽고 빠른 SQL v0
5주차
북마크
유*영
댓글
1
추천
0
조회수
16
조회수
16
답변 완료

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

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


요일 부분이 (일요일 기준 0) 0,1,2,3,4,5,6으로 표시되어서 불편해서 혼자 case when함수를 이용해서 0일때는 일요일, 1일때는 월요일, 2일때는 화요일 ... 로 표시 되도록 했는데 모든 것이 일요일이라고 나와요. 무엇을 잘못한 것일까요?


스파르타 즉문즉답




작성한 코드 및 에러 메세지

select date(date) date_type,

date_format(date(date), '%Y') "년",

date_format(date(date), '%m') "월",

date_format(date(date), '%d') "일",

date_format(date(date), '%w') "요일",

case when "요일" = 0 then'일요일'

when "요일" = 1 then'월요일'

when "요일" = 2 then'화요일'

when "요일" = 3 then'수요일'

when "요일" = 4 then'목요일'

when "요일" = 5 then'금요일'

when "요일" = 6 then'토요일'

end weekend

from payments




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