SQL/String, Date
[프로그래머스 ORACLE SQL]조건에 부합하는 중고거래 상태 조회하기★CASE WHEN THEN
goAhEAd_29
2023. 6. 22. 19:29
728x90
반응형
https://school.programmers.co.kr/learn/courses/30/lessons/164672
SELECT BOARD_ID, WRITER_ID , TITLE, PRICE, CASE
WHEN STATUS = 'SALE' THEN '판매중'
WHEN STATUS = 'DONE' THEN '거래완료'
ELSE '예약중' END AS STATUS FROM USED_GOODS_BOARD
WHERE TO_CHAR(CREATED_DATE, 'YYYY-MM-DD') = '2022-10-05'
ORDER BY BOARD_ID DESC
==> CASE WHEN THEN 활용하기!!!!
728x90
반응형