https://school.programmers.co.kr/learn/courses/30/lessons/144854
코드설명
INNER JOIN + DATE_FORMAT 을 활용합니다.
코드
-- 코드를 입력하세요
SELECT BOOK_ID, AUTHOR.AUTHOR_NAME, DATE_FORMAT(PUBLISHED_DATE, '%Y-%m-%d') AS PUBLISHED_DATE
FROM BOOK
INNER JOIN AUTHOR
ON BOOK.AUTHOR_ID = AUTHOR.AUTHOR_ID
WHERE CATEGORY = '경제'
# WHERE '경제' IN (CATEGORY)
ORDER BY PUBLISHED_DATE ASC;
ORACLE
ON 결합조건에 CATEGORY 조건까지 넣었습니다.
SELECT B.BOOK_ID, A.AUTHOR_NAME, TO_CHAR(B.PUBLISHED_DATE, 'YYYY-MM-DD')
FROM BOOK B
INNER JOIN AUTHOR A
ON B.AUTHOR_ID = A.AUTHOR_ID AND B.CATEGORY = '경제'
ORDER BY B.PUBLISHED_DATE