
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
3주차 숙제 제출을 마쳤습니다.
weekday일 경우 + delivery_time이 25분이상 일때 late 가 되도록 case when then 쿼리를 사용해서 제출했는데, 혹시 if문으로 치환할 수 있나요?
만약 된다면 어떻게 되는지 궁금합니다
**case 구문 과 if구문의 치환 가능 여부와 만약 가능하다면 방법과 과정이 궁금합니다
대체적으로 차이점이나.. 구별점에 대해서 알려주시면 감사할 것 같습니다.
두 가지가 헷갈리네요 ㅠㅠ
작성한 코드 및 에러 메세지
lect order_id,
restaurant_name,
day_of_the_week,
delivery_time,
case
when day_of_the_week = 'weekday' and delivery_time >= 25 then 'late'
when day_of_the_week = 'weekend' and delivery_time >= 30 then 'late'
else 'on-time'
end "지연여부"
from food_orders
