반응형
250x250
Notice
Recent Posts
Recent Comments
Link
목록Case (1)
영국 척척석사 유학생 일기장👩🏻🎓

1) CASECASE 문은 항상 SELECT 절에 써야 함CASE는 WHERE, THEN, END 구성요소를 포함해야함ELSE는 다른 CASE 조건을 충족하지 않는 경우를 위한 선택적 구성 요소WHEN 사이에 조건 연산자 (WHERE) 를 사용하여 조건문 만들 수 있음 (AND, OR 사용 가능)예시 SELECT id, account_id, occurred_at, channel, CASE WHEN channel = 'facebook' OR channel = 'direct' THEN 'yes'ELSE 'no' END AS is_facebookFROM web_eventsORDER BY occurred_at SELECT account_id, occurred_at, total,CASE WHEN total > 5..
코딩공부/SQL
2024. 5. 13. 14:06