๐ซ ๋ฌธ์
๐ซ CODE
SELECT BOOK_ID, DATE_FORMAT(PUBLISHED_DATE, '%Y-%m-%d') AS PUBLISHED_DATE
FROM BOOK
WHERE YEAR(PUBLISHED_DATE) = '2021' AND CATEGORY = '์ธ๋ฌธ'
ORDER BY PUBLISHED_DATE;
๐ซ ํ์ด ์กฐ๊ฑด
1. 2021๋ ์ ์ถํ๋ '์ธ๋ฌธ' ์นดํ ๊ณ ๋ฆฌ์ธ ๊ฒฝ์ฐ
2. ๋์ ID(BOOK_ID), ์ถํ์ผ (PUBLISHED_DATE)์ ์ถ๋ ฅ
3. ์ถํ์ผ ๊ธฐ์ค ์ค๋ฆ์ฐจ์ ์ ๋ ฌ
๐ซ ํ์ด
1. SELECT BOOK_ID, DATE_FORMAT(PUBLISHED_DATE, '%Y-%m-%d') AS PUBLISHED_DATE
- ๋์ ID(BOOK_ID), ์ถํ์ผ (PUBLISHED_DATE)์ ์ถ๋ ฅ
- DATE_FORMAT(PUBLISHED_DATE, '%Y-%m-%d') : ์ถํ์ผ (PUBLISHED_DATE) ๋ -์-์ผ ์ผ๋ก ์ถ๋ ฅ๋๋๋ก
2. WHERE YEAR(PUBLISHED_DATE) = '2021' AND CATEGORY = '์ธ๋ฌธ'
- 2021๋ ์ ์ถํ๋ '์ธ๋ฌธ' ์นดํ ๊ณ ๋ฆฌ์ธ ๊ฒฝ์ฐ
3. ORDER BY PUBLISHED_DATE
- ์ถํ์ผ ๊ธฐ์ค ์ค๋ฆ์ฐจ์ ์ ๋ ฌ